This project has moved and is read-only. For the latest updates, please go here.

[en] How to deremine that currect Zyan Connection is connected? (solved)

Topics: Technical Support
Aug 29, 2014 at 10:04 AM
Edited Aug 29, 2014 at 11:03 AM
Greetings, is there a way to determine if Zyan Connection is connected, accessor or something?
Maybe IsSessionValid suitable for my needs?
Aug 30, 2014 at 11:38 AM
Hello Jesset3r,

Zyan stays always connected. There is no mechnism to explicitly disconnect the connection (except Dispose). Because most channels of Zyan are based on TCP/IP, broken connections can only be deteced, if you try to send data. So there is no need for a "Connected" property. But Zyan can detect unexpected disconnections and fire the Disconnected event in case. You can handle this event to react on unexpected disconnections. It is also possible to try a reconnect (call the Reconnect method). Detection for unexpected disconnections can be turned on or off via the PollingEnabled property of the ZyanConnection object.

I hope this helps.

Best Regards,
Sep 1, 2014 at 7:29 PM

absolutely agree with that.
Even if ZyanConnection had Connected property, it wouldn't add any meaningful information.
The only way to determine whether it's really connected is to send some data to the remote party.

ZyanConnection.Reconnect method is the best available option for checking that.
If it returns true, then the connection is fine, the server is up and running, and the current session is active.
Sep 2, 2014 at 5:58 PM
thank you, for your help:)