private ServiceHubRemoteHostClient(
            HostWorkspaceServices services,
            IServiceBroker serviceBroker,
            ServiceBrokerClient serviceBrokerClient,
            HubClient hubClient,
            Stream stream,
            IRemoteServiceCallbackDispatcherProvider callbackDispatcherProvider)
        {
            _connectionPools = new ConnectionPools(
                connectionFactory: (serviceName, pool, cancellationToken) => CreateConnectionImplAsync(serviceName, callbackTarget: null, pool, cancellationToken),
                capacity: ConnectionPoolCapacity);

            // use the hub client logger for unexpected exceptions from devenv as well, so we have complete information in the log:
            services.GetService <IWorkspaceTelemetryService>()?.RegisterUnexpectedExceptionLogger(hubClient.Logger);

            _services                            = services;
            _serviceBroker                       = serviceBroker;
            _serviceBrokerClient                 = serviceBrokerClient;
            _hubClient                           = hubClient;
            _callbackDispatcherProvider          = callbackDispatcherProvider;
            _endPoint                            = new RemoteEndPoint(stream, hubClient.Logger, incomingCallTarget: this);
            _endPoint.Disconnected              += OnDisconnected;
            _endPoint.UnexpectedExceptionThrown += OnUnexpectedExceptionThrown;
            _endPoint.StartListening();

            _assetStorage                = services.GetRequiredService <ISolutionAssetStorageProvider>().AssetStorage;
            _serializer                  = services.GetRequiredService <ISerializerService>();
            _errorReportingService       = services.GetService <IErrorReportingService>();
            _shutdownCancellationService = services.GetService <IRemoteHostClientShutdownCancellationService>();
            _isRemoteHostServerGC        = RemoteHostOptions.IsServiceHubProcessServerGC(services);
            _isRemoteHostCoreClr         = RemoteHostOptions.IsServiceHubProcessCoreClr(services);
        }
        private ServiceHubRemoteHostClient(
            HostWorkspaceServices services,
            HubClient hubClient,
            HostGroup hostGroup,
            Stream stream)
        {
            _connectionPools = new ConnectionPools(
                connectionFactory: (serviceName, pool, cancellationToken) => CreateConnectionImplAsync(serviceName, callbackTarget: null, pool, cancellationToken),
                capacity: ConnectionPoolCapacity);

            // use the hub client logger for unexpected exceptions from devenv as well, so we have complete information in the log:
            services.GetService <IWorkspaceTelemetryService>()?.RegisterUnexpectedExceptionLogger(hubClient.Logger);

            _services  = services;
            _hubClient = hubClient;
            _hostGroup = hostGroup;

            _endPoint = new RemoteEndPoint(stream, hubClient.Logger, incomingCallTarget: this);
            _endPoint.Disconnected += OnDisconnected;
            _endPoint.UnexpectedExceptionThrown += OnUnexpectedExceptionThrown;
            _endPoint.StartListening();

            _assetStorage = services.GetRequiredService <ISolutionAssetStorageProvider>().AssetStorage;
            _serializer   = services.GetRequiredService <ISerializerService>();
        }
        public JsonRpcConnection(
            HostWorkspaceServices services,
            TraceSource logger,
            object?callbackTarget,
            Stream serviceStream,
            IPooledConnectionReclamation?poolReclamation)
        {
            _solutionAssetStorage = services.GetRequiredService <ISolutionAssetStorageProvider>().AssetStorage;
            _services             = services;

            _serviceEndPoint = new RemoteEndPoint(serviceStream, logger, callbackTarget);
            _serviceEndPoint.UnexpectedExceptionThrown += UnexpectedExceptionThrown;
            _serviceEndPoint.StartListening();

            _poolReclamation = poolReclamation;
#if DEBUG
            _creationCallStack = Environment.StackTrace;
#endif
        }
示例#4
0
 protected void StartService()
 {
     EndPoint.StartListening();
 }