Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » TCP IP » TcpIp_WriteText

TcpIp_WriteText


Module: FoundationLite

Outputs a string through a connected TCP socket.

Name Type Description
inSocket SocketId Connected socket ID.
inText String Text to send through socket.
inSuffix String Additional data to send, like a newline, escaped.

Description

This filter writes textual data to a connected socket.

The text from inText is sent through the connected socket, and if the inSuffix is given, it is sent after. Either parameter can be the empty string, but when both are empty, no data is sent through the socket. The text is sent using UTF-8 encoding.

The value on the inSuffix input can contain escape sequences.

An escaped string contains escape sequences, which are combinations of the \ (backslash) and another character, which have special meaning. The supported escape sequences are:

  • \r - carriage return (ASCII 13)
  • \n - new line (ASCII 10)
  • \t - tab character (ASCII 9)
  • \\ - verbatim backslash \

This filter can raise IoError when the connection is broken or closed by the other side, when the output buffer overflows because the other side is not receiving data or receiving data too slow, or when other network-related error occurred.

Hints

  • Connect inSocket with the output of TcpIp_Connect or TcpIp_Accept.
  • Connect the data you want to send to the inText input.
  • Additional suffix defined on inSuffix will be added at the end of sent chunk.

Examples

Description of usage of this filter can be found in examples and tutorial: IO HTTP Image Download, TcpIp Shoutbox Client.

Remarks

User manual

For more information about using this filter, please follow the link: Using TCP/IP Communication.

Complexity Level

This filter is available on Basic Complexity Level.

Disabled in Lite Edition

This filter is disabled in Lite Edition. It is available only in full, Adaptive Vision Studio Professional version.

See Also

  • TcpIp_ReadLine – Reads from a connected TCP socket until receiving a specific sequence.
  • TcpIp_ReadBuffer – Receives a fixed number of bytes from a connected TCP socket.