Пример #1
0
        private static RpcEndpoint CreateEndpoint(SafeRpcBindingHandle binding_handle, RPC_IF_ID if_id)
        {
            var endpoints = QueryEndpoints(binding_handle, RpcEndpointInquiryFlag.Interface,
                                           if_id, RpcEndPointVersionOption.Exact, null, false).ToArray();
            RpcEndpoint ret = endpoints.Where(ep => ep.BindingString.Equals(binding_handle.ToString(), StringComparison.OrdinalIgnoreCase)).FirstOrDefault();

            return(ret ?? new RpcEndpoint(if_id, new UUID(), null, binding_handle, false));
        }
Пример #2
0
 /// <summary>
 /// Resolve the local binding string for this service from the local Endpoint Mapper.
 /// </summary>
 /// <param name="endpoint">An existing endpoint used for lookup.</param>
 /// <remarks>This only will return a valid value if the service is running and registered with the Endpoint Mapper. It can also hang.</remarks>
 /// <returns>The RPC binding string. Empty string if it doesn't exist or the lookup failed.</returns>
 public static string MapServerToBindingString(RpcEndpoint endpoint)
 {
     return(MapServerToBindingString(endpoint.InterfaceId, endpoint.InterfaceVersion));
 }