Working With Inband Commands

Inband commands (replies) are messages embedded within the TCP data stream. Each inband message has a specific formatting that allows the socket to recognize it in the data stream being received.

Inband messages have many uses. For example, in a network-to-serial converter, you typically pass all serial data through a single TCP connection. At the same time, you often need to send some control commands to the device (e.g., for setup, etc.). This can be done in two ways: through a separate network connection ("out-of-band" respective to the main data connection) or by embedding those commands inside the serial data stream ("inband"). The second method is sometimes better, since very often you want to avoid or cannot have another network connection to your device.

Of course, you could just write Tibbo BASIC/C code that would be separating inband commands from the data, but this would affect the performance (data throughput) of your device considerably. The sock. object natively supports inband commands to avoid this performance penalty. In fact, inband commands will work even when buffer redirection is enabled!

A warning note icon.Inband messages are only possible with TCP. You cannot use inband messages with UDP.

A warning note icon.Do not enable inband messaging on a socket that runs in the TLS mode. Enabling inband will corrupt the encrypted data being sent and received.

In this section: