Winsock...
Hi,
I am having a problem with reading the incoming data... i use:
"send (ctClient.ClientSocket, sendbuffer, strlen(sendbuffer), 0);"
to send the data and then to read:
"int err = recv(ctClient.ClientSocket, packet, sizeof(packet), 0 );"
My qestion is: is it possible to only read one packet at once? And if it, how?
Thanks, Zoot
Not only is this not game-specific, but there''s a special forum just for this sort of problem, which is where I''m moving this to...
Your code should only read at most one packet. I don''t think there''s an easy way to guarantee you get it all in one go. Someone somewhere along the route might have an MTU smaller than your packet size or something like that.
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions ]
Your code should only read at most one packet. I don''t think there''s an easy way to guarantee you get it all in one go. Someone somewhere along the route might have an MTU smaller than your packet size or something like that.
[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions ]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement