by Aaron [aaron dot randolph at veridian dot com] posted on 2003/10/15 |
|
I'm hesitant to call it a bug, but since it works in a normal socket, I'd say it is. If I make a call such as:
byte[] buffer = new Byte[0];
IAsyncResult iar = m_oSocket.BeginReceive(buffer, 0, 0, SocketFlags.Peek, null, null);
it throws a ArgumentOutOfRangeException. I had to modify the SecureSocket code to check to see if the buffer length is 0 before it checks the arguments. Or you could check if size is 0 before testing the rest.
I'm doing this because I want to see if I get any data within a time period without actually reading the data at that moment. |
by Aaron posted on 2003/10/19 |
|
Available is the wrong way to go with what I'm doing. Then I'd have to loop and keep checking, which would take time away from other threads, or use Poll which is just as bad. Using BeginReceive I can put it to sleep until it gets signaled and spend time processing other connections.
What I'm doing is waiting a period of time to see if I get data. If I don't get signaled in that time period, I close the connection. |