Send data over a connected socket
the number of bytes sent. If the number returned is less than len, then an error occured, such as the client disconnecting.
Binds to C-function call in SDL_net.h:
extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket sock, const void *data, int len)
// send a hello over sock //TCPsocket sock; int len,result; char *msg="Hello!"; len=strlen(msg)+1; // add one for the terminating NULL result=SDLNet_TCP_Send(sock,msg,len); if(result<len) { printf("SDLNet_TCP_Send: %s\n", SDLNet_GetError()); // It may be good to disconnect sock because it is likely invalid now. }
SdlNet Class | Tao.Sdl Namespace | SDLNet_TCP_Open | SDLNet_TCP_Close | SDLNet_TCP_Accept | SDLNet_TCP_Recv | SDLNet_TCP_GetPeerAddress | SdlNet.TCPsocket