protected override void OutputThread() { thread.IsBackground = true; try { int timeout = 20; while (state != State.ONLINE) { Thread.Sleep(1000); timeout -= 1; if (timeout == 0) { writer.WriteLine(""); writer.WriteLine("\x1b[1;37mTimed out."); //socket.SafeShutdown (); Thread.Sleep(250); Close(); } } base.OutputThread(); } catch (IOException e) { ProgramLog.Debug.Log("{0}: exception while sending ({1})", Id, e.Message); } catch (SocketException e) { ProgramLog.Debug.Log("{0}: exception while sending ({1})", Id, e.Message); } catch (ObjectDisposedException e) { ProgramLog.Debug.Log("{0}: exception while sending ({1})", Id, e.Message); } catch (Exception e) { ProgramLog.Log(e, "Exception within WriteThread of remote console " + Id); } lock (RConServer.deadClients) RConServer.deadClients.Enqueue(this); ProgramLog.RemoveTarget(this); //socket.SafeShutdown (); socket.SafeClose(); }