A
Andre
Hi,
I'm implementing an asynchron socket Receiving method and I have a
question about EndReceive.
Read()
{
Socket.BeginReceive(buf,0,buf.Length,0,new
AsyncCallback(ReadCallback),dp);
}
ReadCallback(IAsyncResult asyncRes)
{
...
int bytesRead = Socket.EndReceive(asyncRes);
...
}
My question is now, what happens if I try to receive a datapacket
which is greater than the buffer buf? EndReceive returns when when the
buffer buf is full. Can I call EndReceive again? or should I restart
Read()? But how can I know that there are datas waiting for reading?
Thanks
André Betz
http://www.andrebetz.de
I'm implementing an asynchron socket Receiving method and I have a
question about EndReceive.
Read()
{
Socket.BeginReceive(buf,0,buf.Length,0,new
AsyncCallback(ReadCallback),dp);
}
ReadCallback(IAsyncResult asyncRes)
{
...
int bytesRead = Socket.EndReceive(asyncRes);
...
}
My question is now, what happens if I try to receive a datapacket
which is greater than the buffer buf? EndReceive returns when when the
buffer buf is full. Can I call EndReceive again? or should I restart
Read()? But how can I know that there are datas waiting for reading?
Thanks
André Betz
http://www.andrebetz.de