/// <summary> /// create a tracker for preferred provider with custom tick timeout and poll frequency settings /// </summary> /// <param name="pollintervalms"></param> /// <param name="timeoutintervalsec"></param> /// <param name="client"></param> /// <param name="PreferredBroker"></param> /// <param name="connectany"></param> public ConnectionTracker(int pollintervalms, int timeoutintervalsec, IClient client) { _ibclient = client; _tw = new TickWatcher(pollintervalms); _tw.AlertThreshold = timeoutintervalsec; // handle situations when no ticks arrive _tw.GotMassAlert += new Action<int>(_tw_GotMassAlert); _connected = _ibclient.isServerConnected; if (!_connected && (GotConnectFail != null)) GotConnectFail(); if (_connected && (GotConnect != null)) GotConnect(); }
/// <summary> /// create a tracker for preferred provider with custom tick timeout and poll frequency settings /// </summary> /// <param name="pollintervalms"></param> /// <param name="timeoutintervalsec"></param> /// <param name="client"></param> /// <param name="PreferredBroker"></param> /// <param name="connectany"></param> public ConnectionTracker(int pollintervalms, int timeoutintervalsec, IClient client) { _ibclient = client; _tw = new TickWatcher(pollintervalms); _tw.AlertThreshold = timeoutintervalsec; // handle situations when no ticks arrive _tw.GotMassAlert += new Action <int>(_tw_GotMassAlert); _connected = _ibclient.isServerConnected; if (!_connected && (GotConnectFail != null)) { GotConnectFail(); } if (_connected && (GotConnect != null)) { GotConnect(); } }