Receiving data with Winsock

Posted by Tamir on Stack Overflow See other posts from Stack Overflow or by Tamir
Published on 2010-03-23T21:19:20Z Indexed on 2010/03/23 21:23 UTC
Read the original article Hit count: 514

Filed under:
|
|
|
|

Right now, I'm programming the networking for my online game, and I'm not really sure what to do about receiving data. The problem is that I can't really guess the packet's size, so I thought of reading just 4 bytes from the packet and converting them to an int to know what's the packet's size. Then I'll just create a buffer in that size and receive the rest of the packet, is that a good idea?

For your information, I'm using non-blocking i/o.

© Stack Overflow or respective owner

Related posts about winsock

Related posts about c