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

[en] Using Disconnected and Reconnected events (solved)

Topics: Technical Support
Nov 28, 2014 at 12:22 PM
Using client-side Disconnected and Reconnected events might be tricky.
Here is the sample code that demonstrates the usage of these events:

Client-side checklist:
  1. Add event handlers to ZyanConnection.Disconnected and Reconnected.
  2. Make sure Disconnected event handler sets e.Retry to true!
  3. Set ZyanConnection.PollingEnabled to true (heartbeat feature is disabled by default).
  4. Adjust ZyanConnection.PollingInterval as needed (it defaults to 1 heartbeat per minute).
  5. Add an event handler to ZyanConnection.NewLogonNeeded event to handle server restart!
Server-side checklist:
  1. To enable polling diagnostics, set ZyanComponentHost.PollingEventTracingEnabled to true.
  2. Add an event handler to host.ClientHeartbeatReceived event.