private void OnSocketClose(object sender, CloseEventArgs e) { PrimusApi.LogFile(DateTime.Now + " : " + "Socket closed"); _timer.Stop(); OnConnectionUpdateEvent(false, "Socket Closed"); System.Threading.Thread.Sleep(1000); if (_isReconnect) { Reconnect(); } }
private void OnSocketConnect(object sender, EventArgs e) { _timer.Start(); _retryCount = 0; PrimusApi.LogFile(DateTime.Now + " : " + "Socket connected"); OnConnectionUpdateEvent(true, "Socket Connected"); if (_subscriptionMap.Keys.Count > 0) { ReSubscribeFromMap(); SubscribeOrderTradeUpdates(_loginId, _deviceType); } }
private void OnSocketError(object sender, ErrorEventArgs e) { PrimusApi.LogFile(DateTime.Now + " : " + "Socket Error occurred" + e.Message); OnConnectionUpdateEvent(IsConnected, e.Message); }