Exemplo n.º 1
0
 public AutoPing(IDisconnectable disconnector, NetworkStream stream)
 {
     this.disconnector       = disconnector;
     this.stream             = stream;
     autoPingTimer           = new Timer(5 * 1000);
     autoPingTimer.AutoReset = false;
     autoPingTimer.Elapsed  += delegate { AutoPingFunc(); };
 }
Exemplo n.º 2
0
        /// <summary>
        /// Disconnects the object from it's connected source.
        /// </summary>
        public static void Disconnect(this IDisconnectable disconnectable)
        {
            if (disconnectable == null)
            {
                throw new ArgumentNullException(nameof(disconnectable));
            }

            disconnectable.DisconnectAsync(0).Wait();
        }
Exemplo n.º 3
0
 internal InputHandler(NetworkStream networkStream, IDisconnectable disconnector, ChatCore chatCore)
 {
     stream            = networkStream;
     this.disconnector = disconnector;
     this.chatCore     = chatCore;
 }
Exemplo n.º 4
0
 internal Receiver(NetworkStream networkStream, IDisconnectable disconnector, ChatCore chatCore)
 {
     this.disconnector = disconnector;
     stream            = networkStream;
     this.chatCore     = chatCore;
 }
Exemplo n.º 5
0
 internal ChatCore(IDisconnectable disconnector, NetworkStream stream)
 {
     this.stream       = stream;
     this.disconnector = disconnector;
     autoPing          = new AutoPing(disconnector, stream);
 }