Receiving data with Winsock
- by Tamir
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.