/// <summary> /// Handler for Socket Error Event. /// </summary> /// <param name="iSource"></param> /// <param name="iArgs"></param> static void OnSocketError(object iSource, SocketErrorEventArgs iArgs) { GMutex.WaitOne(); Console.WriteLine(); Console.WriteLine(DateTime.Now.TimeOfDay + ": WARN: Socket Status: {0}, Error: {1}", iArgs.Status, iArgs.Error); GMutex.ReleaseMutex(); }
private async Task Discord_SocketError(SocketErrorEventArgs e) { try { await(await e.Client.GetChannelAsync(392429153909080065)).SendMessageAsync("Not Restarting(test): Socket Error"); } catch { } RPClass.SaveData(-1); /* * var process = new Process() * { * StartInfo = new ProcessStartInfo * { * FileName = "/bin/bash", * Arguments = $"-c \"dotnet RPBot-Core.dll\"", * RedirectStandardOutput = true, * UseShellExecute = false, * CreateNoWindow = true, * } * }; * process.Start(); * Environment.Exit(-1); * await Task.Delay(0); */ }
//private Task Discord_ClientErrored(DiscordClient client, ClientErrorEventArgs e) //{ // e.Client.Logger.LogError(TestBotEventId, e.Exception, "Client threw an exception"); // return Task.CompletedTask; //} private Task Discord_SocketError(DiscordClient client, SocketErrorEventArgs e) { var ex = e.Exception is AggregateException ae ? ae.InnerException : e.Exception; client.Logger.LogError(TestBotEventId, ex, "WebSocket threw an exception"); return(Task.CompletedTask); }
/// <summary> /// Callback for disconnects. /// </summary> /// <param name = "sender"> /// The sender. /// </param> /// <param name = "e"> /// The event args. /// </param> private void TcpClient_OnDisconnected(object sender, SocketErrorEventArgs e) { if (Interlocked.Increment(ref this.disconnect) == ClientCount) { this.autoReset.Set(); } }
private async Task Discord_SocketError(SocketErrorEventArgs e) { try { await RPClass.LogChannel.SendMessageAsync("Restarting: Socket Error"); } catch { } RPClass.SaveData(-1); var process = new Process() { StartInfo = new ProcessStartInfo { FileName = "/bin/bash", Arguments = $"-c \"dotnet RPBot-Core.dll\"", RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true, } }; process.Start(); Environment.Exit(-1); await Task.Delay(0); }
private Task Discord_SocketError(SocketErrorEventArgs e) { var ex = e.Exception is AggregateException ae ? ae.InnerException : e.Exception; this.Discord.DebugLogger.LogMessage(LogLevel.Error, "DSP Test", $"WS threw an exception: {ex.GetType()}", DateTime.Now, ex); return(Task.CompletedTask); }
private static Task onSerr(SocketErrorEventArgs e) { Console.WriteLine("!-------------------------------!"); Console.WriteLine(" Exception: SoketError" /*+ e.Exception*/); Console.WriteLine("!-------------------------------!"); return(Task.CompletedTask); }
void _onSocketError(object rec, SocketErrorEventArgs args) { if (OnSocketError != null) { OnSocketError(this, args); } }
private void OnGameClientConnectError(object sender, SocketErrorEventArgs e) { log.WarnFormat("TestClient({1}): Failed to connect to game server: error = {0}", e.SocketError, userId); //TODO connection failed state? or set an error? this.connectionState = TestClientConnectionState.Disconnected; }
private async Task OnSocketErrored(SocketErrorEventArgs e) { if (SocketErrored != null) { await SocketErrored(e); } }
private async Task SocketErrored(SocketErrorEventArgs e) { Console.WriteLine("[Reconnect] Websocket Errored. Attempting to reconnect."); await e.Client.DisconnectAsync(); await e.Client.ConnectAsync(); }
protected internal virtual void OnNetworkError(SocketErrorEventArgs e) { if (NetworkError != null) { NetworkError(this, e); } }
//--------------------------------------------------------------------- void _onSocketError(object rec, SocketErrorEventArgs args) { BuglyAgent.PrintLog(LogSeverity.Log, args.Exception.Message); BuglyAgent.ReportException(args.Exception, args.Exception.Message); _onSocketClose(); }
private Task SocketError(SocketErrorEventArgs e) { Console.WriteLine("Socket Error!"); Console.WriteLine(e.ToString()); Close(); OnClosed?.Invoke(); return(Task.CompletedTask); }
public Task SocketError(SocketErrorEventArgs e) { e.Client.DebugLogger.LogMessage(LogLevel.Error, "nullopt", $"Exception occured: {e.Exception.GetType()}: {e.Exception.Message}", DateTime.Now); return(Task.CompletedTask); }
/// <summary> /// Executed when IRC client connect failed. /// Beware: This is executed by a different thread. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnIrcClientConnectFailed(object sender, SocketErrorEventArgs e) { // close connection and exit ServerConnection.Disconnect(); IsRunning = false; IrcChannel = null; Log("ERROR", LOG_IRCCONNECTERROR); }
private void QueryDispatcher_SocketError(object sender, SocketErrorEventArgs e) { if (!Connected) { return; } Console.WriteLine($"Something went wrong: {e.SocketError}"); Disconnect(); }
//------------------------------------------------------------------------- void _onSocketError(object rec, SocketErrorEventArgs args) { //this.tcpSocket = null; if (OnSocketError != null) { OnSocketError.Invoke(this, args); } }
//--------------------------------------------------------------------- void _onSocketError(object rec, SocketErrorEventArgs args) { this.tcpSocket = null; if (OnSocketError != null) { OnSocketError(this, args); } }
//--------------------------------------------------------------------- void _onSocketError(object rec, SocketErrorEventArgs args) { //if (args != null && args.Exception != null) //{ // BuglyAgent.PrintLog(LogSeverity.Log, args.Exception.Message); // BuglyAgent.ReportException(args.Exception, args.Exception.Message); //} _onSocketClose(); }
private void TMNRPCClient_SocketError(object sender, SocketErrorEventArgs e) { SocketAsyncEventArgs.Dispose(); SocketAsyncEventArgs = null; if (e.SocketError == System.Net.Sockets.SocketError.ConnectionReset && ServerClosedConnection != null) { ServerClosedConnection(this, EventArgs.Empty); } }
//------------------------------------------------------------------------- void _onSocketError(object rec, SocketErrorEventArgs args) { EbLog.Note("ClientNetMonitor._onSocketError()"); //FloatMsgInfo f_info; //f_info.msg = "连接已断开!"; //f_info.color = Color.red; //UiMgr.Instance.FloatMsgMgr.createFloatMsg(f_info); _onSocketClose(); }
private Task Discord_SocketErrored(DiscordClient sender, SocketErrorEventArgs e) { var ex = e.Exception; while (ex is AggregateException) { ex = ex.InnerException; } sender.Logger.LogCritical(LogEvent, $"Socket threw an exception {ex.GetType()}: {ex.Message}", DateTime.Now); return(Task.CompletedTask); }
private Task Discord_SocketErrored(SocketErrorEventArgs e) { var ex = e.Exception; while (ex is AggregateException) { ex = ex.InnerException; } e.Client.DebugLogger.LogMessage(LogLevel.Critical, LOG_TAG, $"Socket threw an exception {ex.GetType()}: {ex.Message}", DateTime.Now); return(Task.CompletedTask); }
private void OnGameClientDisconnected(object sender, SocketErrorEventArgs e) { if (log.IsDebugEnabled) { log.DebugFormat("TestClient({0}): disconnected from game server.", userId); } if (this.connectionState != TestClientConnectionState.Stopped) { this.connectionState = TestClientConnectionState.Disconnected; } }
private void OnSocketError(object sender, SocketErrorEventArgs e) { Log.Error("MJpeg server error " + e.Message); // ISSUE: reference to a compiler-generated field EventHandler <StreamErrorEventArgs> streamError = this.StreamError; if (streamError == null) { return; } streamError((object)this, new StreamErrorEventArgs(string.Format("Socket error: {0}", (object)e.Message), e)); }
private async Task DiscordSocketErrored(SocketErrorEventArgs e) { Log(this, new LogEventArgs { Type = LogType.Error, Message = $"SocketErrored triggered: {e.Exception}" }); //HACK: This should try and reconnect should something wrong happen. await DiscordClient.ConnectAsync(); await Task.Delay(0); }
//--------------------------------------------------------------------- void _onError(object client, SocketErrorEventArgs args) { lock (LockWorker) { SocketEvent socket_event; socket_event.type = eSocketEventType.Error; socket_event.client = client; socket_event.args = args; mSocketEvent.Enqueue(socket_event); } }
/// <summary> /// This event is raised when a socket exception has occured /// ConnectionRefused: /// Teamspeak is not running /// Increment reconnect timer time Interval with 1 second until 15 seconds /// Disconnect /// other: /// Disconnect /// </summary> private void QueryDispatcher_SocketError(object sender, SocketErrorEventArgs e) { // do not handle connection lost errors because they are already handled by QueryDispatcher_ServerClosedConnection if (e.SocketError == SocketError.ConnectionReset) { return; } //if (e.SocketError == SocketError.ConnectionRefused) Disconnect(); }
void socketServer_OnSocketError(object sender, SocketErrorEventArgs e) { if (sender is AsyncSocketConnection) { var conn = sender as AsyncSocketConnection; log.ErrorFormat("通信错误: tid:{0}, {1}, {2}", conn.TerminalId, e.Error.Message, e.Error.StackTrace); } else { SocketError se = (SocketError)e.ErrorCode; log.ErrorFormat("通信错误", se.GetDescription() + "," + e.Error.Message); } }
private void QueryDispatcher_SocketError(object sender, SocketErrorEventArgs e) { // do not handle connection lost errors because they are already handled by QueryDispatcher_ServerClosedConnection if (e.SocketError == SocketError.ConnectionReset) { return; } // this event is raised when a socket exception has occured MessageBox.Show("Socket error!! Error Code: " + e.SocketError); // force disconnect Disconnect(); }
private void OnGameClientConnectError(object sender, SocketErrorEventArgs e) { log.WarnFormat("GAME: Failed to connect to game server: error = {0}", e); }
private void OnMasterClientConnectError(object sender, SocketErrorEventArgs e) { log.WarnFormat("MASTER: Connect to master failed: err={0}", e.SocketError); this.resetEvent.Set(); }
/// <summary> /// Logs an error. /// </summary> /// <param name = "sender"> /// The sender. /// </param> /// <param name = "e"> /// The event args. /// </param> private static void TcpClient_OnConnectError(object sender, SocketErrorEventArgs e) { log.Error(e.SocketError); }