Anatomy of a Socket

Top  Previous  Next

A socket is composed of a send/receive logic that actually handles UDP, TCP (including HTTP) communications, and of 6 buffers. Each socket is capable of maintaining one connection with another node (host) on a network.

The socket object contains properties, methods and events which relate both to the buffers and the send/receive logic.

The buffers available are:

The RX buffer, which stores data incoming from the host on the other side of a connection.
The TX buffer, which stores data which is due for sending to the host on the other side of a connection.
The TX2 buffer, which is used internally, and only when inband commands are enabled.
The CMD buffer, which is used to store incoming inband commands (messages). It is used only when inband commands are enabled.
The RPL buffer, which is used to store outgoing inband replies (messages). It is used only when inband commands are enabled.
The VAR buffer, which is used to store HTTP request string. It is used only when the socket is in the HTTP mode.