Sends data on a connected socket.
TCPSend ( mainsocket, data )
mainsocket | The connected socket identifier (SocketID) as returned by a TCPConnect() function. |
data | binary/string to be send to the connected socket. |
Success: | the number of bytes sent to the connected socket. |
Failure: | 0 and sets the @error flag to non-zero. |
@error: | Windows API WSAGetLastError return value (see MSDN). |
If Unicode strings need to be transmitted they must be encoded/decoded with StringToBinary()/BinaryToString().
A test of TCPSend() and TCPRecv() can be launch with the following button :
StringToBinary, TCPConnect, TCPListen, TCPRecv, TCPStartup, TCPTimeout (Option)