private void server_ConnectionLost(object sender, DisconnectEventArgs e) { AddLine(ServerStrings.ConnectionLost.With(SocketErrorTranslator.GetMessage(e.SocketErrorCode))); if (e.Reason != DisconnectReason.UserInitiated) { AddLine(ServerStrings.AttemptingReconnect); ThreadHelper.InvokeAfter(TimeSpan.FromSeconds(4), delegate { server.Connect(); }); } }
private void Server_OnConnectFail(object sender, ConnectFailedEventArgs e) { AddLine(ServerStrings.ConnectionFailedMessage.With(SocketErrorTranslator.GetMessage(e.SocketErrorCode))); ThreadHelper.InvokeAfter(TimeSpan.FromSeconds(4), delegate { server.Connect(); }); }