Server.Server.acceptConnection C# (CSharp) Méthode

acceptConnection() private méthode

private acceptConnection ( Int32 _inputsize ) : void
_inputsize Int32
Résultat void
        private void acceptConnection(Int32 _inputsize)
        {
            int clientid = clientsockets.Count;
            Socket clinetsocket = clientsockets[clientid-1];

                ServerInfoEventArgs args = new ServerInfoEventArgs();
                args.consoleinfo = "Connection accepted from " + clinetsocket.RemoteEndPoint + "\n";
                OnNeedLog(args);

                ServerClient client = new ServerClient();
                client.id = clientid;
                client.port = ((IPEndPoint)clinetsocket.RemoteEndPoint).Port.ToString();
                client.ip = ((IPEndPoint)clinetsocket.RemoteEndPoint).Address.ToString();
                client.name = recieveData(clinetsocket,_inputsize);   // itt várakozik az inputra
                client.gametype = "";

                lobby.add(client);

                clinetsocket.Send(new ASCIIEncoding().GetBytes("Users in the lobby.\n" + lobby.getClientsName()));
        }