Working With Inband Commands

Top  Previous  Next

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, i.e. 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" way). 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 a BASIC 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 the buffer redirection is enabled!


Inband messages are only possible with TCP transport protocol. You cannot use inband messages with UDP!