private static RpcClientProxy GetProxyInner <T>(ServerUri solvedUri, ResolvableUri contextUri) { RpcClientInterface intf = RpcClientInterfaceFactory <T> .GetOne(); if (_channels.Count == 0) { throw new Exception("You *MUST* Register at least 1 client channel at first"); } RpcClientChannel channel; if (!_channels.TryGetValue(solvedUri.Protocol, out channel)) { throw new Exception(string.Format("{0} protocol:'{1}' not found", solvedUri.ToString(), solvedUri.Protocol)); } ResolvableUri r = contextUri as ResolvableUri; string role = r != null ? r.Service : ""; RpcConnection conn = GetConnection(solvedUri, role); RpcClientProxy proxy = new RpcClientProxy(conn, intf, contextUri); proxy.Timeout = channel.Timeout; return(proxy); }
public RpcClientProxy GetCallbackProxy <T>() { return(new RpcClientProxy(_trans.Connection, RpcClientInterfaceFactory <T> .GetOne(), null)); }