public BidirectionalStream(NetworkReader from, NetworkWriter to, PacketHandler packetHandler)
        {
            reader = from;
            writer = to;

            handler = packetHandler;

            var rStart = new ThreadStart(Run);
            readerThread = new Thread(rStart);
            readerThread.Start();
        }
Example #2
0
 private void PassData(NetworkReader from, NetworkWriter to)
 {
     Packet packet;
     {
         for (; ; )
         {
             packet = Packet.Get(from);
             packet.Write(to);
         }
     }
 }
Example #3
0
 public abstract void Write(NetworkWriter writer);
Example #4
0
 public static void Put(Packet packet, NetworkWriter writer)
 {
     packet.Write(writer);
     writer.Flush();
 }