The tcp_send function sends the data packet to a remote machine. The argument socket specifies the socket handle to use for communication on the local machine. The argument buf points to the constructed TCP data packet. The argument dlen specifies the number of bytes in the data packet to send. If the tcp_send fails to send the data, it releases the memory buffer specified with the argument buf and returns. This function can not send the data when: - the TCP connection is not established
- the previously sent data is not acknowledged from the remote machine.
The tcp_send function is in the RL-TCPnet library. The prototype is defined in rtl.h. note - You must allocate the memory using tcp_get_buf before calling tcp_send.
- The socket must already be open and connected for communication.
- It is not allowed to call tcp_send from the callback function of the socket.
|