コード例 #1
0
        private JsonRpc GetRpcServer(Stream stream, IResolveAssemblyReferenceTaskHandler handler)
        {
            IJsonRpcMessageHandler serverHandler = RpcUtils.GetRarMessageHandler(stream);
            JsonRpc rpc = new JsonRpc(serverHandler, handler);

            return(rpc);
        }
コード例 #2
0
ファイル: RarClient.cs プロジェクト: shaikhanas1993/msbuild
        private IResolveAssemblyReferenceTaskHandler GetRpcClient()
        {
            ErrorUtilities.VerifyThrowInternalErrorUnreachable(_clientStream != null);

            IJsonRpcMessageHandler handler = RpcUtils.GetRarMessageHandler(_clientStream);

            return(JsonRpc.Attach <IResolveAssemblyReferenceTaskHandler>(handler));
        }
コード例 #3
0
ファイル: FullServer.cs プロジェクト: ixmilia/bcad
        public FullServer(IJsonRpcMessageHandler messageHandler)
        {
            Workspace = new RpcServerWorkspace();
            RegisterWithWorkspace(Workspace);

            var serverRpc = new JsonRpc(messageHandler);
            var server    = new ServerAgent(Workspace, serverRpc);

            serverRpc.AddLocalRpcTarget(server);
            ((HtmlDialogService)Workspace.DialogService).Agent = server;
            serverRpc.TraceSource.Listeners.Add(new Listener());
            Agent = server;
        }
コード例 #4
0
    public JsonRpcWithFatalExceptionsTests(ITestOutputHelper logger)
        : base(logger)
    {
        this.server = new Server();
        var streams = Nerdbank.FullDuplexStream.CreateStreams();

        this.messageHandler = new HeaderDelimitedMessageHandler(streams.Item1, streams.Item1);
        this.clientRpc      = new JsonRpcWithFatalExceptions(this.messageHandler);
        this.serverRpc      = new JsonRpcWithFatalExceptions(new HeaderDelimitedMessageHandler(streams.Item2, streams.Item2), this.server);

        this.serverRpc.TraceSource = new TraceSource("Server", SourceLevels.Error);
        this.clientRpc.TraceSource = new TraceSource("Client", SourceLevels.Error);

        this.serverRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));
        this.clientRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));

        this.clientRpc.StartListening();
        this.serverRpc.StartListening();
    }
コード例 #5
0
    public JsonRpcWithMessageFactoryTests(ITestOutputHelper logger)
        : base(logger)
    {
        this.server = new Server();
        var streams = Nerdbank.FullDuplexStream.CreateStreams();

        this.clientMessageFormatter = new MessageFormatterWithMessageFactory();
        this.clientMessageHandler   = new HeaderDelimitedMessageHandler(streams.Item1, streams.Item1, this.clientMessageFormatter);

        this.serverMessageFormatter = new MessageFormatterWithMessageFactory();
        this.serverMessageHandler   = new HeaderDelimitedMessageHandler(streams.Item2, streams.Item2, this.serverMessageFormatter);

        this.clientRpc = new JsonRpc(this.clientMessageHandler);
        this.serverRpc = new JsonRpc(this.serverMessageHandler, this.server);

        this.serverRpc.TraceSource = new TraceSource("Server", SourceLevels.Information);
        this.clientRpc.TraceSource = new TraceSource("Client", SourceLevels.Information);

        this.serverRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));
        this.clientRpc.TraceSource.Listeners.Add(new XunitTraceListener(this.Logger));

        this.clientRpc.StartListening();
        this.serverRpc.StartListening();
    }
コード例 #6
0
 public RemoteTargetJsonRpc(IJsonRpcMessageHandler messageHandler)
     : base(messageHandler)
 {
 }
コード例 #7
0
 public RemoteTargetJsonRpc(IJsonRpcMessageHandler messageHandler, object?target)
     : base(messageHandler, target)
 {
 }
 public DelegatedJsonRpc(IJsonRpcMessageHandler handler)
     : base(handler)
 {
 }
 public DelegatedJsonRpc(IJsonRpcMessageHandler handler, object target)
     : base(handler, target)
 {
 }
コード例 #10
0
 public JsonRpcWithStringIds(IJsonRpcMessageHandler handler)
     : base(handler)
 {
 }
コード例 #11
0
 public JsonRpcWithFatalExceptions(IJsonRpcMessageHandler messageHandler, object target = null)
     : base(messageHandler, target)
 {
     this.IsFatalExceptionCount = 0;
 }
コード例 #12
0
 protected override JsonRpc CreateJsonRpc(IJsonRpcMessageHandler handler)
 {
     return(new NuGetJsonRpc(handler));
 }
コード例 #13
0
 internal NuGetJsonRpc(IJsonRpcMessageHandler messageHandler)
     : base(messageHandler)
 {
 }