Пример #1
0
        public virtual void OnAccept( IAsyncResult ar )
        {
            try
            {
                Socket newSocket = listenSocket.EndAccept( ar );

                if ( newSocket != null )
                {
                    RemoteSaver newClient = new RemoteSaver( newSocket, new Server.RemoveClientDelegate( this.RemoveClient ) );
                    clients.Add( newClient );
                    newClient.Start();
                }
            }
            catch {}
            try
            {
                listenSocket.BeginAccept( new AsyncCallback( this.OnAccept ), listenSocket );
            }
            catch
            {
                Dispose();
            }
        }
Пример #2
0
        public virtual void OnAccept(IAsyncResult ar)
        {
            try
            {
                Socket newSocket = listenSocket.EndAccept(ar);

                if (newSocket != null)
                {
                    RemoteSaver newClient = new RemoteSaver(newSocket, new Server.RemoveClientDelegate(this.RemoveClient));
                    clients.Add(newClient);
                    newClient.Start();
                }
            }
            catch {}
            try
            {
                listenSocket.BeginAccept(new AsyncCallback(this.OnAccept), listenSocket);
            }
            catch
            {
                Dispose();
            }
        }