Esempio n. 1
0
        public PacketPipe(TcpClient client, PacketHandler handler)
        {
            this.client = client;
            this.handler = handler;

            var stream = client.GetStream();
            reader = new NetworkReader(stream);
            writer = new NetworkWriter(stream);

            readThread = new Thread(new ThreadStart(ReadLoop));
            writeThread = new Thread(new ThreadStart(WriteLoop));
            readThread.Start();
            writeThread.Start();
        }
Esempio n. 2
0
 public override void Handle(PacketHandler handler)
 {
     handler.Handle(this);
 }
Esempio n. 3
0
 public abstract void Handle(PacketHandler handler);
Esempio n. 4
0
 public void SetHandler(PacketHandler handler)
 {
     this.handler = handler;
 }