Пример #1
0
        private void Server_ClientAccepted(object sender, SocketHelper.Events.ClientAcceptedEventArgs args)
        {
            string        endpoint = args.Adapter.RemoteEndPoint.ToString();
            SocketAdapter adapter  = args.Adapter;

            addEvent(adapter);
            adapter.Send((int)ParamCode.EnsureConnect);
        }
        private void Server_ClientAccepted(object sender, SocketHelper.Events.ClientAcceptedEventArgs args)
        {
            string endpoint = args.Adapter.RemoteEndPoint.ToString();

            Console.WriteLine("ClientAccepted:" + endpoint);
            SocketAdapter adapter = args.Adapter;

            _sockets.RemoveAll(_ => _.Adapter == null);
            _sockets.Add(new DownloadSocketManager(adapter));
        }