Sending data to a TCP/IP client connection and receiving data back on the same connection (asynchronous)

Send fixed-size data to a TCP/IP client connection and receive fixed-size data back on the same connection (asynchronously), by the use of a message flow with MQInput, TCPIPClientOutput, TCPIPClientInput, and MQOutput nodes.

About this task

Scenario: An application sends asynchronous data between TCP/IP client connections.

Instructions: The following steps describe how to create a message flow to send data through a client connection and wait on the same connection for a reply to be returned. The request is performed asynchronously in two different flows (the TCPIPClientInput does not wait for data to be returned on this connection, but instead monitors all available connections).

Procedure

  1. Create a message flow called TCPIP_Task7 with an MQInput node, a TCPIPClientOutput node, a TCPIPClientInput node, and an MQOutput node.
    For more information, see Creating a message flow.
  2. Connect the Out terminal of the MQInput node to the In terminal of the TCPIPClientOutput node.
  3. Connect the Out terminal of the TCPIPClientInput node to the In terminal of the MQOutput node.
    One message flow consisting of MQInput and TCPIPClientOutput nodes, and another message flow consisting of TCPIPClientInput, and MQOutput nodes.
  4. On the MQInput node, set the Queue name property (on the Basic tab) to TCPIP.TASK7.IN1.
  5. Set the following properties of the TCPIPClientOutput node:
    1. On the Basic tab, set the Connection details property to 14147.
    2. On the Advanced tab, set the Output stream modification property to Reserve output stream.
    3. On the Records and elements tab, set the following properties:
      • Set the Record definition property to Fixed length.
      • Set the Length property to 100.
  6. Set the following properties of the TCPIPClientInput node:
    1. On the Basic tab, set the Connection details property to 14147.
    2. On the Advanced tab, set the Output stream modification property to Release output stream and reset Reply ID.
    3. On the Records and elements tab, set the following properties:
      • Set the Record detection property to Fixed length.
      • Set the Length property to 100.
  7. On the MQOutput node, set the Queue name property (on the Basic tab) to TCPIP.TASK7.OUT1.
  8. Save the message flow.