/// <summary> /// Create tcp proxy /// </summary> /// <param name="proxyId"></param> /// <param name="url"></param> /// <param name="encoding"></param> /// <param name="timeout"></param> /// <returns></returns> public static RemoteService CreateHttpProxy(string proxyId, string url, Encoding encoding, int? timeout) { var client = new HttpRemoteClient(url, encoding, timeout); client.Callback += OnNetHttpCallback; var proxy = new RemoteService(proxyId, client); client.RemoteTarget = proxy; return proxy; }
/// <summary> /// Create tcp proxy /// </summary> /// <param name="proxyId"></param> /// <param name="host"></param> /// <param name="port"></param> /// <param name="heartInterval"></param> /// <returns></returns> public static RemoteService CreateTcpProxy(string proxyId, string host, int port, int heartInterval) { var client = new SocketRemoteClient(host, port, heartInterval); client.Callback += OnNetTcpCallback; var proxy = new RemoteService(proxyId, client); client.RemoteTarget = proxy; return proxy; }