when I call socket.Receive(Buffer), is there a way where the call will block until a certain number of bytes are read? What is the typical way to make a receive loop if not?
when I call socket.Receive(Buffer), is there a way where the call will block until
Share
You would typically need to use the overload which accepts an offset and count, and manually loop (checking the return value) until you have enough. For example:
This might also be a bit easier if you wrap the socket in a
NetworkStream.