private void OnSocketConnect(Socket socket) { Client client = new Client(socket); ConnectedSockets.Add(client.Id, client); client.OnClientDisconnectedEvent += OnSocketDisconnect; client.OnDataReceivedEvent += (Client _client, byte[] data) => OnClientDataReceivedEvent?.Invoke(_client, data); OnClientConnectionEvent?.Invoke(client); }
protected virtual void ClientConnectionEvent(string message, bool connected) => OnClientConnectionEvent?.Invoke(new ClientEventArgs(this, message, connected));