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: Error event and socket close
addingon

From: USA
Posts: 7
Member Since: 04/05/06
posted January 21, 2014 11:24 AM

Hi,

When the error event gets fired in the V4.4 product, is the connection guaranteed to get closed by the time the event occurs? Or should that event include a test for connection state (perhaps after a DoEvents)? The Dart ActiveX control had some errors that were "info" and didn't close the socket. I'd like to know if that same behavior might be expected in .NET.

Regards,

Ray
Nick B (Admin)

From: Utica, NY USA
Posts: 584
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted January 21, 2014 12:04 PM

Hello Ray,

The State property should reflect the current state of the connection after an exception is thrown. When a connection-fatal exception is thrown, the connection is closed before it is thrown externally, and State will reflect that you're not connected. There are non-fatal exceptions though; timeout, etc.

The only time that our component will raise the Error event is if an error occurs after ReadAsync/ReceiveAsync is called, before the delegate specified is raised. In all other cases, it is raised either from an unhandled exception on a worker thread that was created with our Start() method (we automatically marshal those), or if you marshal an exception with your code.
addingon

From: USA
Posts: 7
Member Since: 04/05/06
posted January 21, 2014 3:02 PM

Thank you, Nick.

That answered my question nicely.

Regards,

Ray
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX