Receive data on a TCP/IP
server socket, then send the data to the same connection, by the use
of a message flow with TCPIPServerInput and TCPIPServerOutput nodes.
About this task
Scenario: A client application opens a TCP/IP socket
and sends an undefined document (of any format or size). The end of
the document is signalled by the client closing the output stream
(but not the connection), and waiting for the same data to be sent
back.
Instructions: The following steps describe how
to write a message flow that can receive the data and echo it back
to the same connection:
Procedure
- Create a message flow called TCPIP_Task3 with
a TCPIPServerInput node
and a TCPIPServerOutput node.
- Connect the Out terminal of the TCPIPServerInput node to the
In terminal of the TCPIPServerOutput node.
- Set the following properties of the TCPIPServerInput node:
- On the Basic tab, set the Connection details property to 14143.
- On the Advanced tab, set the Input stream modification property
to Reserve input stream and release
at end of flow.
- Set the following properties of the TCPIPServerOutput node:
- On the Basic tab, set the Connection details property to 14143.
- On the Request tab, set the ID location property to LocalEnvironment/TCPIP/Input/ConnectionDetails/Id.
- On the Advanced tab, set the Close connection property to After data has been sent.
- Save the message flow.