Sending and receiving data (except RPC and CICS)
The sendString, sendBuffer, sendRecord, sendStringAsLLAsciiZ, and sendIncorporatingLength actions of the Connection part enable your application to send data to another application on the network. The receive, receiveBuffer and receiveWithLengthInData actions of the Connection part enable your application to receive data from another application on the network.
To send data to the server
Make an event-to-action connection to the sendString action of the Connection part. The sendString action requires the string parameter, which represents the string you want to send. From your connection that triggers the sendString action, connect the string attribute to the string part you want to send (for example, the string attribute of a text entry field).
The sent event indicates that the connection part has successfully sent data to the server.
You can also send other types of data by using the sendBuffer, sendRecord, sendStringAsLLAsciiZ, and sendIncorporatingLength actions of the connection part.
To receive data from the server
Make an event-to-action connection to the receive action of the Connection part. Connect the normalResult attribute of this connection to the initializeWith: action of the Receive Buffer or Message part. From the Receive Buffer or Message part, you can connect the contentsAsString attribute to a text field to see the received data as a string.
The Receive Buffer or Message part then contains state data that is protocol-specific. For example, the MQI Message part contains a message descriptor that contains the message ID, reply to queue manager, and queue names. The APPC and CPI-C Receive Buffer parts contain status and data state.
You can use the receiveWithLengthInData action to receive variable length buffers that have a four byte prefixed length field in Big endian format. The received event indicates that the connection part has received data from the server.
Last modified date: 01/29/2015