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
 
Connection status for asynhronous sockets  
by Viking
posted on 2005/10/19

How to find out connection status if using asynchronous sockets?

I'm trying to avoid the hang on SecureSocket.Receive() when connection is lost.

To get this status for synchronous sockets, one can use Poll + Available before calling Receive.

by Viking
posted on 2005/10/20

Just to clarify the post above.
I'm hanging on EndReceive() expecting to receive some bytes from the server but they are not coming. After some winsock timeout connection gets broken.

In order to prevent this timeout i'm using Poll+Available to learn the current server status IMMIDIATELY if working with synchronous sockets.
What should I do with asynchronous ones? Is there a way?

by Neil
posted on 2006/01/12

The call to BeginReceive returns a IAsyncResult, which has a property called IsComplete. This is set to true once the asynchronous operation has completed.

 

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