News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
SecureSocket.BeginReceive bug  
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 Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/10/19

SocketFlags.Peek is currently unsupported for SSL/TLS sockets; only SocketFlags.None is supported.

If you need to know whether data is available, you should use the Available property. We'll put SocketFlags.Peek support on our TODO list.

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.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.