Skip to main content
gamedev.net
🔒 Locked

Packet Size Problem...

Started by Mike 6 replies 400+ views
Original Post
Mike
Mike
The server is sending packets of 4032 bytes and the Client is recieving packets of 4380 bytes. How on earth is the client recieving more data then is sent? Any ideas would be apriciated greatly mike.
TangentZ
TangentZ
The "extra" bytes are the header used by TCP/IP or UDP or
whatever protocol you''re using.



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
Cahaan
Cahaan
I was thinking about that Tangentz but...
4380 - 4032 = 348 bytes !
Isn''t it a bit too much for a header ? Well I guess the 400kb are not sent in one big buffer but in several times; it could explain that.
Darkhaven Beta-test stage coming soon.
Mike
Mike
I don''t believe that''s the problem. Most of the time the client recieves the proper number of bytes 4036. It seems that it only randomely recieve the 4830 bytes. I can''t figure this out. (TCP/IP)

mike.
Cahaan
Cahaan
Anyway is it really an issue ?
What kind of sockets are u using ? (non)blocking/async ?
Why not writing the buffer in a file or somewhere else so that you can check what''s going on in it ?
Darkhaven Beta-test stage coming soon.
Mike
Mike
is it an issue? i would say so, i always like my code to work as it''s suposed to. i managed to fix the problem. the problem was that the recv function was reading part of the next data packet, a packet that i didn''t realize was getting sent.

thanks for the help,
mike.
fingh
fingh
Well, there was a huge thread about this recently here

It''s long, and there''s a lot of name calling. There is also a lot of good information explaining what is happening.
Dire.Wolf
Dire.Wolf
quote:
Original post by tangentz
The "extra" bytes are the header used by TCP/IP or UDP or
whatever protocol you''re using.



Kami no Itte ga ore ni zettai naru!


Hmmm, no. The transport and network layer gooble these pieces of information (the headers) up (unless you are using raw sockets.)

I hope that was just a mental fart and not a serious answer...



Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.