예제 #1
0
 public LocalBrokerClient(string name, BrokerConnectionInfo connectionInfo, IServiceContainer services, IConsole console, IRSessionProvider sessionProvider)
     : base(name, connectionInfo, _credentials, console, services, sessionProvider)
 {
     _rHome     = connectionInfo.Uri.LocalPath;
     _services  = services;
     IsVerified = true;
 }
예제 #2
0
        public LocalBrokerClient(string name, BrokerConnectionInfo connectionInfo, IServiceContainer services, IConsole console, string rhostDirectory = null)
            : base(name, connectionInfo, _credentials, console, services)
        {
            _rHome          = connectionInfo.Uri.LocalPath;
            _services       = services;
            _rhostDirectory = rhostDirectory ?? Path.GetDirectoryName(typeof(RHost).GetTypeInfo().Assembly.GetAssemblyPath());

            IsVerified = true;
        }
예제 #3
0
        public RemoteBrokerClient(string name, BrokerConnectionInfo connectionInfo, ICoreServices services, IConsole console, CancellationToken cancellationToken)
            : base(name, connectionInfo, new RemoteCredentialsDecorator(connectionInfo.CredentialAuthority, connectionInfo.Name, services.Security, services.MainThread), services.Log, console)
        {
            _console           = console;
            _services          = services;
            _cancellationToken = cancellationToken;

            CreateHttpClient(connectionInfo.Uri);
            HttpClientHandler.ServerCertificateValidationCallback = ValidateCertificateHttpHandler;
        }
예제 #4
0
        public RemoteBrokerClient(string name, IRSessionProvider sessionProvider, BrokerConnectionInfo connectionInfo, IServiceContainer services, IConsole console, CancellationToken cancellationToken)
            : base(name, connectionInfo, new RemoteCredentialsDecorator(connectionInfo.CredentialAuthority, connectionInfo.Name, services), console, services)
        {
            _console           = console;
            _services          = services;
            _cancellationToken = cancellationToken;
            _sessionProvider   = sessionProvider;

            CreateHttpClient(connectionInfo.Uri);
            HttpClientHandler.ServerCertificateCustomValidationCallback = ValidateCertificateHttpHandler;
        }
예제 #5
0
 private static async Task TestBrokerConnectionWithRHost(IBrokerClient brokerClient, CancellationToken cancellationToken) {
     var callbacks = new NullRCallbacks();
     var connectionInfo = new BrokerConnectionInfo(nameof(TestBrokerConnectionAsync), callbacks);
     var rhost = await brokerClient.ConnectAsync(connectionInfo, cancellationToken);
     try {
         var rhostRunTask = rhost.Run(cancellationToken);
         callbacks.SetReadConsoleInput("q()\n");
         await rhostRunTask;
     } finally {
         rhost.Dispose();
     }
 }
예제 #6
0
 public bool Equals(BrokerConnectionInfo other) => other.ParametersId.EqualsOrdinal(ParametersId) && Equals(other.Uri, Uri);
예제 #7
0
 public override async Task<RHost> ConnectAsync(BrokerConnectionInfo connectionInfo, CancellationToken cancellationToken = default(CancellationToken)) {
     await EnsureBrokerStartedAsync();
     return await base.ConnectAsync(connectionInfo, cancellationToken);
 }
예제 #8
0
 public async Task <RHost> ConnectAsync(BrokerConnectionInfo connectionInfo, CancellationToken cancellationToken = default(CancellationToken), ReentrancyToken reentrancyToken = default(ReentrancyToken))
 {
     using (await _connectArwl.ReaderLockAsync(cancellationToken, reentrancyToken)) {
         return(await _broker.ConnectAsync(connectionInfo, cancellationToken, reentrancyToken));
     }
 }
예제 #9
0
 public LocalBrokerClient(string name, BrokerConnectionInfo connectionInfo, IServiceContainer services)
     : base(name, connectionInfo, _credentials, services)
 {
     _rHome    = connectionInfo.Uri.LocalPath;
     _services = services;
 }
예제 #10
0
 public Task <RHost> ConnectAsync(BrokerConnectionInfo connectionInfo, CancellationToken cancellationToken = default(CancellationToken), ReentrancyToken reentrancyToken = default(ReentrancyToken)) => Result;
예제 #11
0
        public override async Task <RHost> ConnectAsync(BrokerConnectionInfo connectionInfo, CancellationToken cancellationToken = default(CancellationToken), ReentrancyToken reentrancyToken = default(ReentrancyToken))
        {
            await EnsureBrokerStartedAsync();

            return(await base.ConnectAsync(connectionInfo, cancellationToken, reentrancyToken));
        }