StartHandshake() public method

Starts communication with the client.
public StartHandshake ( ) : void
return void
Exemplo n.º 1
0
	///<summary>Called when there's an incoming client connection waiting to be accepted.</summary>
	///<param name="ar">The result of the asynchronous operation.</param>
	public override void OnAccept(IAsyncResult ar) {
		try {
			Socket NewSocket = ListenSocket.EndAccept(ar);
			if (NewSocket != null) {
				SocksClient NewClient = new SocksClient(NewSocket, new DestroyDelegate(this.RemoveClient), AuthList);
				AddClient(NewClient);
				NewClient.StartHandshake();
			}
		} catch {}
		try {
			//Restart Listening
			ListenSocket.BeginAccept(new AsyncCallback(this.OnAccept), ListenSocket);
		} catch {
			Dispose();
		}
	}
Exemplo n.º 2
0
 ///<summary>Called when there's an incoming client connection waiting to be accepted.</summary>
 ///<param name="ar">The result of the asynchronous operation.</param>
 public override void OnAccept(IAsyncResult ar)
 {
     try {
         Socket NewSocket = ListenSocket.EndAccept(ar);
         if (NewSocket != null)
         {
             SocksClient NewClient = new SocksClient(NewSocket, new DestroyDelegate(this.RemoveClient), AuthList);
             AddClient(NewClient);
             NewClient.StartHandshake();
         }
     } catch {}
     try {
         //Restart Listening
         ListenSocket.BeginAccept(new AsyncCallback(this.OnAccept), ListenSocket);
     } catch {
         Dispose();
     }
 }