コード例 #1
0
ファイル: Socks5Processor.cs プロジェクト: tylrr123/Tor.NET
        /// <summary>
        /// Starts processing the connection by establishing relevant protocol commands and resolving the address.
        /// </summary>
        /// <param name="remoteEP">The remote end-point targetted for connection.</param>
        /// <param name="callback">The method raised once the connection process has completed or failed.</param>
        public Socks5AsyncResult BeginProcessing(IPEndPoint remoteEP, ProcessorCallback callback)
        {
            if (remoteEP == null)
            {
                throw new ArgumentNullException("remoteEP");
            }

            this.callback = callback;
            this.endPoint = remoteEP;

            socket.BeginConnectInternal(new IPEndPoint(IPAddress.Parse(socket.ProxyAddress), socket.ProxyPort), OnSocketConnect, socket);

            return(asyncResult);
        }
コード例 #2
0
ファイル: Socks5Processor.cs プロジェクト: tylrr123/Tor.NET
        /// <summary>
        /// Starts processing the connection by establishing relevant protocol commands and resolving the address.
        /// </summary>
        /// <param name="host">The address of the remote host to connect to.</param>
        /// <param name="port">The port number of the remote host to connect to.</param>
        /// <param name="callback">The method raised once the connection process has completed or failed.</param>
        public Socks5AsyncResult BeginProcessing(string host, int port, ProcessorCallback callback)
        {
            if (host == null)
            {
                throw new ArgumentNullException("host");
            }

            this.callback   = callback;
            this.endAddress = host;
            this.endPort    = port;

            socket.BeginConnectInternal(new IPEndPoint(IPAddress.Parse(socket.ProxyAddress), socket.ProxyPort), OnSocketConnect, socket);

            return(asyncResult);
        }
コード例 #3
0
 internal ProcessorController(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
 {
     callback = new ProcessorCallback(Process);
     Interop.ProcessorController.SetCallback(SwigCPtr, callback);
 }