void ISocketClientEventListener.OnConnectionFailed(ITcpConnectionInfo connectionInfo, SocketError socketError) { if (_eventListener != null) { _eventListener.OnConnectionFailed(connectionInfo, socketError); } ReconnectServer(); }
private void OnConnectionFailed(ITcpConnection connection, SocketError socketError) { ConnectionStatus = TcpConnectionStatus.ConnectionFailed; _logger.InfoFormat("TCP connection failed: [remoteEndPoint:{0}, localEndPoint:{1}, connectionId:{2:B}, socketError:{3}].", connection.RemoteEndPoint, connection.LocalEndPoint, connection.ConnectionId, socketError); if (_eventListener != null) { _eventListener.OnConnectionFailed(connection, socketError); } }
void ISocketClientEventListener.OnConnectionFailed(ITcpConnectionInfo connectionInfo, SocketError socketError) { if (_eventListener != null) { _eventListener.OnConnectionFailed(connectionInfo, socketError); } Thread.Sleep(1000); if (_tcpClient.IsStarted && !_tcpClient.IsStopped) { ReconnectServer(); } }