예제 #1
0
        public async Task Disconnect()
        {
            if (proxyClient != null)
            {
                await proxyClient.Stop();

                proxyClient   = null;
                RemotePort    = 0;
                RemoteAddress = null;
            }
        }
예제 #2
0
        public async Task <ProxyClient> GetProxyClient(string address, int port)
        {
            if (proxyClient == null)
            {
                proxyClient = new ProxyClient();
            }

            if (RemotePort != port || RemoteAddress != address)
            {
                await proxyClient.Stop();

                await proxyClient.Start(address, port);

                RemotePort    = port;
                RemoteAddress = address;
            }
            return(proxyClient);
        }