Пример #1
0
        public AmqpServiceClient(
            IotHubConnectionProperties connectionProperties,
            bool useWebSocketOnly,
            ServiceClientTransportSettings transportSettings,
            ServiceClientOptions options)
        {
            var iotHubConnection = new IotHubConnection(connectionProperties, useWebSocketOnly, transportSettings);

            Connection                = iotHubConnection;
            OpenTimeout               = IotHubConnection.DefaultOpenTimeout;
            OperationTimeout          = IotHubConnection.DefaultOperationTimeout;
            _faultTolerantSendingLink = new FaultTolerantAmqpObject <SendingAmqpLink>(CreateSendingLinkAsync, Connection.CloseLink);
            _feedbackReceiver         = new AmqpFeedbackReceiver(Connection);
            _fileNotificationReceiver = new AmqpFileNotificationReceiver(Connection);
            _iotHubName               = connectionProperties.IotHubName;
            _clientOptions            = options;
            _httpClientHelper         = new HttpClientHelper(
                connectionProperties.HttpsEndpoint,
                connectionProperties,
                ExceptionHandlingHelper.GetDefaultErrorMapping(),
                s_defaultOperationTimeout,
                transportSettings.HttpProxy,
                transportSettings.ConnectionLeaseTimeoutMilliseconds);

            // Set the trace provider for the AMQP library.
            AmqpTrace.Provider = new AmqpTransportLog();
        }
Пример #2
0
 internal AmqpServiceClient(IotHubConnection iotHubConnection, IHttpClientHelper httpClientHelper)
 {
     this.iotHubConnection         = iotHubConnection;
     this.faultTolerantSendingLink = new FaultTolerantAmqpObject <SendingAmqpLink>(this.CreateSendingLinkAsync, iotHubConnection.CloseLink);
     this.feedbackReceiver         = new AmqpFeedbackReceiver(iotHubConnection);
     this.fileNotificationReceiver = new AmqpFileNotificationReceiver(iotHubConnection);
     this.httpClientHelper         = httpClientHelper;
 }
Пример #3
0
 // internal test helper
 internal ServiceClient(IotHubConnection connection, IHttpClientHelper httpClientHelper)
 {
     Connection                = connection;
     _httpClientHelper         = httpClientHelper;
     _feedbackReceiver         = new AmqpFeedbackReceiver(Connection);
     _fileNotificationReceiver = new AmqpFileNotificationReceiver(Connection);
     _faultTolerantSendingLink = new FaultTolerantAmqpObject <SendingAmqpLink>(CreateSendingLinkAsync, Connection.CloseLink);
 }
        public AmqpServiceClient(IotHubConnectionString iotHubConnectionString)
        {
            var iotHubConnection = new IotHubConnection(iotHubConnectionString, AccessRights.ServiceConnect);

            this.iotHubConnection         = iotHubConnection;
            this.openTimeout              = IotHubConnection.DefaultOpenTimeout;
            this.operationTimeout         = IotHubConnection.DefaultOperationTimeout;
            this.sendingPath              = "/messages/deviceBound";
            this.faultTolerantSendingLink = new FaultTolerantAmqpObject <SendingAmqpLink>(this.CreateSendingLinkAsync, this.iotHubConnection.CloseLink);
            this.feedbackReceiver         = new AmqpFeedbackReceiver(this.iotHubConnection);
            this.iotHubName       = iotHubConnectionString.IotHubName;
            this.httpClientHelper = new HttpClientHelper(
                iotHubConnectionString.HttpsEndpoint,
                iotHubConnectionString,
                ExceptionHandlingHelper.GetDefaultErrorMapping(),
                DefaultOperationTimeout,
                client => {});
        }
        public AmqpServiceClient(IotHubConnectionString iotHubConnectionString, bool useWebSocketOnly, ServiceClientTransportSettings transportSettings)
        {
            var iotHubConnection = new IotHubConnection(iotHubConnectionString, AccessRights.ServiceConnect, useWebSocketOnly, transportSettings);

            Connection                = iotHubConnection;
            OpenTimeout               = IotHubConnection.DefaultOpenTimeout;
            OperationTimeout          = IotHubConnection.DefaultOperationTimeout;
            _sendingPath              = "/messages/deviceBound";
            _faultTolerantSendingLink = new FaultTolerantAmqpObject <SendingAmqpLink>(CreateSendingLinkAsync, Connection.CloseLink);
            _feedbackReceiver         = new AmqpFeedbackReceiver(Connection);
            _fileNotificationReceiver = new AmqpFileNotificationReceiver(Connection);
            _iotHubName               = iotHubConnectionString.IotHubName;
            _httpClientHelper         = new HttpClientHelper(
                iotHubConnectionString.HttpsEndpoint,
                iotHubConnectionString,
                ExceptionHandlingHelper.GetDefaultErrorMapping(),
                s_defaultOperationTimeout,
                transportSettings.HttpProxy);
        }