public ServerInfo(PipeServiceBinder server, PipeCallInvoker callInvoker,
                   GrpcConnection connection, RemoteObjectStores stores,
                   LldbMockFactories mockFactories)
 {
     Server        = server;
     CallInvoker   = callInvoker;
     Connection    = connection;
     Stores        = stores;
     MockFactories = mockFactories;
 }
        // This method should grow as we find necessary to interact with other services.
        private void BindServices(ServiceBinderBase server, RemoteObjectStores stores,
                                  LldbMockFactories mockFactories)
        {
            var remoteFrameRpc =
                new RemoteFrameRpcServiceImpl(stores.Value, stores.Function, stores.Symbol,
                                              stores.Module, stores.Frame, stores.Thread);
            var remoteModuleRpc = new SbModuleRpcServiceImpl(
                stores.Module, stores.Address, stores.Section, mockFactories.FileSpec);
            var remoteThreadRpc = new RemoteThreadRpcServiceImpl(
                stores.Process, stores.Thread,
                stores.Frame, stores.Module);

            RemoteFrameRpcService.BindService(server, remoteFrameRpc);
            SbModuleRpcService.BindService(server, remoteModuleRpc);
            RemoteThreadRpcService.BindService(server, remoteThreadRpc);
        }
        private ServerInfo CreateServer(
            PipeCallInvokerFactory callInvokerFactory, GrpcConnectionFactory connectionFactory)
        {
            PipeCallInvoker callInvoker = callInvokerFactory.Create();
            GrpcConnection  connection  = connectionFactory.Create(callInvoker);

            string[] inPipeHandles, outPipeHandles;
            callInvoker.GetClientPipeHandles(out inPipeHandles, out outPipeHandles);

            // Note: The client's out handles are the server's in handles and vice versa.
            PipeServiceBinder server = new PipeServiceBinder(outPipeHandles, inPipeHandles);
            var stores        = new RemoteObjectStores();
            var mockFactories = new LldbMockFactories();

            BindServices(server, stores, mockFactories);
            server.Start();
            return(new ServerInfo(server, callInvoker, connection, stores, mockFactories));
        }