Exemplo n.º 1
0
 public SharedAmqpConnection(AmqpChannelFactory amqpChannelFactory, string host, int port, AmqpSettings settings) : base(new object())
 {
     this.amqpChannelFactory = amqpChannelFactory;
     this.host     = host;
     this.port     = port;
     this.settings = settings;
 }
Exemplo n.º 2
0
            private void Cleanup()
            {
                AmqpChannelFactory.SharedAmqpConnection sharedAmqpConnection;
                string str = AmqpChannelFactory.CreateSharedAmqpConnectionsKey(this.host, this.port);

                this.amqpChannelFactory.sharedAmqpConnections.TryRemove(str, out sharedAmqpConnection);
                this.amqpChannelFactory.amqpChannelEvents.OnSessionClosed();
            }
Exemplo n.º 3
0
 protected override IOutputChannel OnCreateChannel(EndpointAddress address, Uri via)
 {
     AmqpChannelFactory.SharedAmqpLink       orAdd;
     AmqpChannelFactory.SharedAmqpConnection sharedAmqpConnection;
     if (!this.sharedAmqpLinks.TryGetValue(via.AbsoluteUri, out orAdd))
     {
         string str = AmqpChannelFactory.CreateSharedAmqpConnectionsKey(via.Host, via.Port);
         if (!this.sharedAmqpConnections.TryGetValue(str, out sharedAmqpConnection))
         {
             sharedAmqpConnection = this.sharedAmqpConnections.GetOrAdd(str, new AmqpChannelFactory.SharedAmqpConnection(this, via.Host, via.Port, this.transportBindingElement.AmqpSettings));
         }
         orAdd = this.sharedAmqpLinks.GetOrAdd(via.AbsoluteUri, new AmqpChannelFactory.SharedAmqpLink(this, sharedAmqpConnection, via));
     }
     return(new AmqpChannelFactory.AmqpOutputChannel(orAdd, this, address, via));
 }
Exemplo n.º 4
0
 public SharedAmqpLink(AmqpChannelFactory amqpChannelFactory, AmqpChannelFactory.SharedAmqpConnection sharedConnection, Uri via) : base(new object())
 {
     this.amqpChannelFactory   = amqpChannelFactory;
     this.sharedAmqpConnection = sharedConnection;
     this.via = via;
 }
Exemplo n.º 5
0
 public AmqpOutputChannel(AmqpChannelFactory.SharedAmqpLink sharedAmqpLink, AmqpChannelFactory channelFactory, EndpointAddress address, Uri via) : base(channelFactory)
 {
     this.sharedAmqpLink     = sharedAmqpLink;
     this.RemoteAddress      = address;
     this.Via                = via;
     this.id                 = string.Concat(base.GetType().Name, Interlocked.Increment(ref AmqpChannelFactory.AmqpOutputChannel.instanceIdCounter));
     this.onAmqpObjectClosed = new EventHandler(this.OnAmqpObjectClosed);
 }