Back to Aurora Vision Library website

You are here: Start » Function Reference » System » TCP IP » TcpIp_WriteText

TcpIp_WriteText


Header: STD.h
Namespace: avl
Module: FoundationLite

Outputs a string through a connected TCP socket.

Syntax

void avl::TcpIp_WriteText
(
	avl::SocketId inSocket,
	const atl::String& inText,
	const atl::String& inSuffix
)

Parameters

Name Type Default Description
Input value inSocket SocketId Connected socket ID.
Input value inText const String& Text to send through socket.
Input value inSuffix const String& \"\\\\r\\\\n\" 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.

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.