Advertisement

Empty info!

Started by March 08, 2002 03:45 PM
-1 comments, last by BradDaBug 22 years, 10 months ago
I''m using SDLNet with SDL. Is it normal for a socket to act like its got data ready, only to give nothing when you check it for data? Why does it do that? Am I doing something wrong? Here''s the code I''m using to check the sockets: void *data = malloc(100); memset(data, 0, 100); if (!SDLNet_CheckSockets(sockSet, 0)) return(0); //Now we check our client to see if it needs anything taken care of. //Most likely it''ll have some data it wants to share with us. if ((client != NULL) && (SDLNet_SocketReady(client->GetTCPSocket()))) { client->Receive(data, 100); WriteLog("DATA: %s", (char*)data); } When I check the data, its usually NULL. Why?
I like the DARK layout!

This topic is closed to new replies.

Advertisement