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(); }
public override void Handle(PacketHandler handler) { handler.Handle(this); }
public abstract void Handle(PacketHandler handler);
public void SetHandler(PacketHandler handler) { this.handler = handler; }