GLBasic User Manual

Main sections


rv% = SOCK_TCPSEND(dest_sock%, msg$)

Sends a message via TCP to a connected socket - one that you connected to via a command like SOCK_TCPACCEPT() or SOCK_TCPCONNECT().
msg$ is the message text to send. GLBasic will send the exact text without appending any special characters to it, so any extra characters you'd like sent (eg \0 -> chr$(0)) you will need to append yourself.
The return value rv% indicates the number of sent characters (bytes). If rv%=-1, an error occurred.

You can retrieve any error messages with NETGETLASTERROR$().

See also...