static void listener_SocketAccepted(object sender, SocketAcceptedEventHandler e)
        {
            Console.WriteLine("New Connection: {0}\n{1}\n===========", e.Accepted.RemoteEndPoint, DateTime.Now);

            clients.Add(new Client(e.Accepted));
            int currIndex = clients.Count - 1;
            Console.WriteLine(clients[currIndex].ID);
            clients[currIndex].indexOffset = currIndex;
            clients[currIndex].Received += new Client.ClientReceivedHandler(client_Received);
            clients[currIndex].Disconnected += new Client.ClientDisconnectedHandler(client_Disconnected);
        }
Exemple #2
0
        static void listener_SocketAccepted(object sender, SocketAcceptedEventHandler e)
        {
            Console.WriteLine("New Connection: {0}\n{1}\n===========", e.Accepted.RemoteEndPoint, DateTime.Now);

            clients.Add(new Client(e.Accepted));
            int currIndex = clients.Count - 1;

            Console.WriteLine(clients[currIndex].ID);
            clients[currIndex].indexOffset   = currIndex;
            clients[currIndex].Received     += new Client.ClientReceivedHandler(client_Received);
            clients[currIndex].Disconnected += new Client.ClientDisconnectedHandler(client_Disconnected);
        }