The tcp_get_buf function allocates memory for the TCP send buffer into which your application can write the outgoing data packet. The argument size specifies the number of data bytes that the application wants to send. After the TCP frame has been sent and an acknowledgement has been received from the remote host, TCPnet automatically de-allocates the memory used by the send buffer in tcp_send function. A default Maximum Segment Size of 1460 bytes is defined at startup. However, when establishing a connection with a remote machine, TCPnet might negotiate a different (smaller) value for the Maximum Segment Size. The tcp_get_buf function is in the RL-TCPnet library. The prototype is defined in rtl.h. note - Your application must call the tcp_get_buf function each time it wants to send a TCP data packet.
- The size of the allocated memory must not exceed the TCP Maximum Segment Size (1460 bytes).
- Writing more data than the allocated size of the data buffer overwrites the Memory Manager Block links and causes TCPnet to crash.
|