private void OnSoftDisconnectWriter() { Log.EntryNormal(LogW, "Writer soft disconnect"); //Log.Console(info.remote + " writer softly disconnected"); Queue <SocketWriterMessage> msgs = writer.ExtractAllMessages(); writer = null; writerStatus = WriteStatus.READY; while (msgs.Any() && msgs.Peek().type == SocketWriterMessageType.SOFT_DISCONNECT) { msgs.Dequeue(); } if (msgs.Any()) { ConnectAsync(); while (msgs.Any()) { writer.SendMessage(msgs.Dequeue()); } } }
private void OnSoftDisconnectReader() { Log.EntryNormal(LogR, "Reader soft disconnect"); //Log.Console(info.remote + " reader softly disconnected"); reader = null; readerStatus = ReadStatus.READY; //SoftDisconnect(); }
public void Close() { Log.EntryNormal(log, "Closing all"); foreach (var h in hosts.Values) { h.Close(); } sl.TerminateThread(); }
private void NewIncomingConnection(Handshake info, Socket sck) { Log.EntryNormal(log, "New connection: " + info); MyAssert.Assert(hosts.ContainsKey(info.local.hostname)); hosts.GetValue(info.local.hostname).NewIncomingConnection(info, sck); }