[quoted text, click to view] "Khadim" <asher.mehboob@gmail.com> wrote in message
news:1138722994.898435.264260@g44g2000cwa.googlegroups.com...
[lots of stuff]
khadim - I can't be bothered to check all your code but I will tell you one
tip for TCP usage that you haven't covered:
There is (in general) no connection between the number of bytes in a send
and the number of bytes in a receive - The implementation and the network
are entitled to chop it up into any number of chunks each of which may
require a separate call to receive - this is not a C# or .NET thing it is
TCP and therefore in any low level socket interface.
consequently all low level receive routines have to accumulate bytes into a
buffer with repeated receives until they know that they have a complete
message or that the other end has closed (usualy indicated by a receive of 0
bytes).
with the async routines this gets quite messy so i tend to avoid them and
use a separate thread and the synchronous methods.
Usually what happens is that people just send small messages which means
that they will usually get away with it until they increase their package
size to greater than one ethernet payload and their app fails.