public void RemoveAmqpUnit(AmqpUnit amqpUnit)
        {
            amqpUnit.Dispose();
            IAmqpUnitManager amqpConnectionPool = ResolveConnectionPool(amqpUnit.GetDeviceIdentity().IotHubConnectionString.HostName);

            amqpConnectionPool.RemoveAmqpUnit(amqpUnit);
        }
Example #2
0
        public AmqpUnit CreateAmqpUnit(
            DeviceIdentity deviceIdentity,
            Func <MethodRequestInternal, Task> methodHandler,
            Action <Twin, string, TwinCollection> twinMessageListener,
            Func <string, Message, Task> eventListener)
        {
            IAmqpUnitManager amqpConnectionPool = ResolveConnectionPool(deviceIdentity.IotHubConnectionString.HostName);

            return(amqpConnectionPool.CreateAmqpUnit(
                       deviceIdentity,
                       methodHandler,
                       twinMessageListener,
                       eventListener));
        }
        public AmqpUnit CreateAmqpUnit(
            DeviceIdentity deviceIdentity,
            Func <MethodRequestInternal, Task> onMethodCallback,
            Action <Twin, string, TwinCollection, IotHubException> twinMessageListener,
            Func <string, Message, Task> onModuleMessageReceivedCallback,
            Func <Message, Task> onDeviceMessageReceivedCallback,
            Action onUnitDisconnected)
        {
            IAmqpUnitManager amqpConnectionPool = ResolveConnectionPool(deviceIdentity.IotHubConnectionString.HostName);

            return(amqpConnectionPool.CreateAmqpUnit(
                       deviceIdentity,
                       onMethodCallback,
                       twinMessageListener,
                       onModuleMessageReceivedCallback,
                       onDeviceMessageReceivedCallback,
                       onUnitDisconnected));
        }