Esempio n. 1
0
        public async Task Start() {
            serviceSocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
            serviceSocket.Bind(new IPEndPoint(IPAddress.Parse(this.Host),this.Port));
            serviceSocket.Listen(64);
            
            while (true) {
                Socket newSocket = await serviceSocket.AcceptSocketAsync();
                this.clientSocket.Add(newSocket);

                Task.Run(async()=>await Listen(newSocket));
            }
        }