Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Socket not connected when receive times out
olihelgi

From: Kopavogur, Iceland
Posts: 3
Member Since: 02/18/04
posted February 18, 2004 10:41 AM

I'm developing a client server application which uses your SSL Socket for .NET product.

I'm testing the timeout in the Tcp class and set the receive timeout to e.g. 2 sec., connect, send no data and therefore don't receive any data. The Receive() function throws a SocketException after 2 sec. and then the socket is no longer connected. I tried using both sync Receive() and async BeginReceive() and the socket was disconnected in both cases.

This is not good since the protocol that I'm using states that I must try 3 times to send and receive before I can stop trying.

Is there any way to keep the socket connected even when a timeout occurs ?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted February 18, 2004 10:49 AM

You really shouldn't be calling receive unless you are expecting data. I can't think of a single protocol that would behave in the manner that you describe.

Is there some reason that you can't reconnect and try again?
olihelgi

From: Kopavogur, Iceland
Posts: 3
Member Since: 02/18/04
posted February 18, 2004 11:52 AM

Actually I'm expecting data when I'm calling Receive or BeginReceive. But the protocol that I'm using is rather old and is based on modem connections which can be unreliable and therefore the client has to try 3 times to receive and send.

There is no reason why I cannot reconnect and try again but if I wanted to implement the protocol properly then this is what I have to do.

However I think that it would be a good idea to keep the socket connected when it times out and then the user that is using your product can decide whether he/she wants to close the socket or not.
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX