public async Task Disconnect() { if (proxyClient != null) { await proxyClient.Stop(); proxyClient = null; RemotePort = 0; RemoteAddress = null; } }
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); }