G
Guest
I am writing a client to request game server information. All of the servers
use UDP to accept commands and send responses. Most of the servers are fine,
but every once in a while a server sends back more than 2k (2048 bytes) of
data and it gets truncated. No matter how large I set the receive buffer, I
only get 2k of data.
Here is what I have tried so far:
- Set the receive buffer to 4096 using Socket.SetSocketOption
- Continue to append received data to a buffer while Socket.Available > 0.
After the first iteration, the available property is zero.
- I have tried both Receive and ReceiveFrom methods. No change.
- Tried asynchronous BeginReceive and EndReceive. I try to invoke begin
receive from EndReceive if the end of data value does not exist, but the
second receive just times out and I'm stuck with the partial data.
Does anyone have any ideas on how I can get more than 2K?
use UDP to accept commands and send responses. Most of the servers are fine,
but every once in a while a server sends back more than 2k (2048 bytes) of
data and it gets truncated. No matter how large I set the receive buffer, I
only get 2k of data.
Here is what I have tried so far:
- Set the receive buffer to 4096 using Socket.SetSocketOption
- Continue to append received data to a buffer while Socket.Available > 0.
After the first iteration, the available property is zero.
- I have tried both Receive and ReceiveFrom methods. No change.
- Tried asynchronous BeginReceive and EndReceive. I try to invoke begin
receive from EndReceive if the end of data value does not exist, but the
second receive just times out and I'm stuck with the partial data.
Does anyone have any ideas on how I can get more than 2K?