Пример #1
0
 public IotHubConnection(IotHubConnectionString connectionString, AccessRights accessRights)
 {
     this.connectionString     = connectionString;
     this.accessRights         = accessRights;
     this.faultTolerantSession = new FaultTolerantAmqpObject <AmqpSession>(this.CreateSessionAsync, this.CloseConnection);
     this.refreshTokenTimer    = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
 }
Пример #2
0
 public AmqpDeviceClient(IotHubConnectionString connectionString, bool useWebSocketOnly)
 {
     this.IotHubConnection                      = connectionCache.GetConnection(connectionString, useWebSocketOnly);
     this.deviceId                              = connectionString.DeviceId;
     this.openTimeout                           = IotHubConnection.DefaultOpenTimeout;
     this.operationTimeout                      = IotHubConnection.DefaultOperationTimeout;
     this.DefaultReceiveTimeout                 = IotHubConnection.DefaultOperationTimeout;
     this.faultTolerantEventSendingLink         = new FaultTolerantAmqpObject <SendingAmqpLink>(this.CreateEventSendingLinkAsync, this.IotHubConnection.CloseLink);
     this.faultTolerantDeviceBoundReceivingLink = new FaultTolerantAmqpObject <ReceivingAmqpLink>(this.CreateDeviceBoundReceivingLinkAsync, this.IotHubConnection.CloseLink);
 }
Пример #3
0
 public AmqpDeviceClient(IotHubConnectionString connectionString, AmqpTransportSettings transportSettings)
 {
     this.IotHubConnection                      = connectionCache.GetConnection(connectionString, transportSettings);
     this.deviceId                              = connectionString.DeviceId;
     this.openTimeout                           = IotHubConnection.DefaultOpenTimeout;
     this.operationTimeout                      = IotHubConnection.DefaultOperationTimeout;
     this.DefaultReceiveTimeout                 = IotHubConnection.DefaultOperationTimeout;
     this.faultTolerantEventSendingLink         = new FaultTolerantAmqpObject <SendingAmqpLink>(this.CreateEventSendingLinkAsync, this.IotHubConnection.CloseLink);
     this.faultTolerantDeviceBoundReceivingLink = new FaultTolerantAmqpObject <ReceivingAmqpLink>(this.CreateDeviceBoundReceivingLinkAsync, this.IotHubConnection.CloseLink);
     this.prefetchCount                         = transportSettings.PrefetchCount;
 }
Пример #4
0
        public IotHubConnection(IotHubConnectionString connectionString, AccessRights accessRights, AmqpTransportSettings amqpTransportSettings)
        {
            this.connectionString     = connectionString;
            this.accessRights         = accessRights;
            this.faultTolerantSession = new FaultTolerantAmqpObject <AmqpSession>(this.CreateSessionAsync, this.CloseConnection);

#if WINDOWS_UWP
            this.refreshTokenTimer = new IOThreadTimerSlim(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
#else
            this.refreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
#endif

            this.amqpTransportSettings = amqpTransportSettings;
        }