Beispiel #1
0
 public FileServer(int id, TcpSocket tcpSocket, Dictionary <byte, FileServerTcpPacketHandler> fileServerPacketProcessor)
 {
     this.ID = id;
     this.fileServerPacketProcessor = fileServerPacketProcessor;
     this.fileServerState           = new FileServerState(id);
     this.TcpSocketWorker           = new TcpSocketWorker(tcpSocket, this.HandleTcpPacket);
     this.TcpSocketWorker.Closed   += TcpSocketWorker_Closed;
 }
Beispiel #2
0
 public MasterServer(TcpSocket tcpSocket)
 {
     this.TcpSocketWorker         = new TcpSocketWorker(tcpSocket, this.HandleTcpPacket);
     this.TcpSocketWorker.Closed += (sender, args) =>
     {
         this.TcpSocketWorkerClosed?.Invoke(this, EventArgs.Empty);
     };
 }
 public Client(int id, TcpSocket tcpSocket, Dictionary <byte, ClientTcpPacketHandler> clientPacketProcessor)
 {
     this.ID = id;
     this.clientPacketProcessor   = clientPacketProcessor;
     this.clientState             = new ClientState(id);
     this.TcpSocketWorker         = new TcpSocketWorker(tcpSocket, this.HandleTcpPacket);
     this.TcpSocketWorker.Closed += TcpSocketWorker_Closed;
 }
Beispiel #4
0
 public MasterServer(TcpSocket tcpSocket, Dictionary <byte, MasterServerTcpPacketHandler> packetProcessor)
 {
     this.packetProcessor        = packetProcessor;
     this.TcpSocketWorker        = new TcpSocketWorker(tcpSocket, HandleTcpPacket);
     this.TcpSocketWorkerClosed += MasterServer_TcpSocketWorkerClosed;
 }