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(); } }
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(); } }