private static ServiceHost GetServiceHost(IJsonRpcHost jsonRpcHost = null) { return(new ServiceHost { jsonRpcHost = jsonRpcHost }); }
/// <summary> /// Constructs a new service host that with ability to provide custom protocol channels /// </summary> /// <param name="protocolChannel">Channel to use for JSON RPC input/output</param> public ServiceHost(ChannelBase protocolChannel) : this() { Validate.IsNotNull(nameof(protocolChannel), protocolChannel); jsonRpcHost = new JsonRpcHost(protocolChannel); // Register any request that the service host will handle SetEventHandler(ExitNotification.Type, HandleExitNotification, true); SetAsyncRequestHandler(ShutdownRequest.Type, HandleShutdownRequest, true); SetAsyncRequestHandler(InitializeRequest.Type, HandleInitializeRequest, true); }