PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

strange winsock bug...

hi,

i've found the following strange bug in the windows ce winsock implementation. if you call recv() with a really large buffer (say 1MB) it sometimes fails to read UDP packets (returns -1). smaller buffers (32KB) or TCP work fine.

has anybody experienced this strange behavior?
on 'real' windows this works fine. at least with these buffer sizes :)

bye,
DANIEL
Are you sure it's Windows and not your network card dropping the packet?

It may be difficult to ascertain the party responsible for the drop, because UDP is inherently unreliable (i.e. there're no acknowlegements or requests for missed packets).
well it does work fine if the receive buffer i provide is just smaller. the message that comes in is exactly 98 bytes large so it will fit into one UDP packet.

to my knowledge the problem must be inside winsock since it seems to do something wrong when i provide a large buffer to write to and works correctly if that buffer is small.

now that i know i will provide smaller buffers but this should be documented somehow...

DANIEL
Dave H · 09 Apr 2003, 20:27 UTC — strange winsock bug...
drgoldie wrote:
hi,

i've found the following strange bug in the windows ce winsock implementation. if you call recv() with a really large buffer (say 1MB) it sometimes fails to read UDP packets (returns -1). smaller buffers (32KB) or TCP work fine.

has anybody experienced this strange behavior?
on 'real' windows this works fine. at least with these buffer sizes :)

bye,
DANIEL


Well since the UDP packet length is 16-bit, I'd hazard a guess that what you are trying to do is impossible...