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; }
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; }
public MasterServer(TcpSocket tcpSocket, Dictionary <byte, MasterServerTcpPacketHandler> packetProcessor) { this.packetProcessor = packetProcessor; this.TcpSocketWorker = new TcpSocketWorker(tcpSocket, HandleTcpPacket); this.TcpSocketWorkerClosed += MasterServer_TcpSocketWorkerClosed; }