Contains the AMQP settings for a connection.
示例#1
0
        internal Connection(IBufferManager bufferManager, AmqpSettings amqpSettings, Address address,
                            IAsyncTransport transport, Open open, OnOpened onOpened, IHandler handler)
            : this(address, (ushort)(amqpSettings.MaxSessionsPerConnection - 1), (uint)amqpSettings.MaxFrameSize)
        {
            transport.SetConnection(this);

            this.handler            = handler;
            this.BufferManager      = bufferManager;
            this.MaxLinksPerSession = amqpSettings.MaxLinksPerSession;
            this.onOpened           = onOpened;
            this.writer             = new TransportWriter(transport, this.OnIoException);

            // after getting the transport, move state to open pipe before starting the pump
            if (open == null)
            {
                open = new Open()
                {
                    ContainerId  = amqpSettings.ContainerId,
                    HostName     = amqpSettings.HostName ?? this.address.Host,
                    ChannelMax   = this.channelMax,
                    MaxFrameSize = this.maxFrameSize,
                    IdleTimeOut  = (uint)amqpSettings.IdleTimeout
                };
            }

            if (open.IdleTimeOut > 0)
            {
                this.heartBeat = new HeartBeat(this, open.IdleTimeOut);
            }

            this.SendHeader();
            this.SendOpen(open);
            this.state = ConnectionState.OpenPipe;
        }
示例#2
0
        internal Connection(IBufferManager bufferManager, AmqpSettings amqpSettings, Address address,
                            IAsyncTransport transport, Open open, OnOpened onOpened)
            : this((ushort)(amqpSettings.MaxSessionsPerConnection - 1), (uint)amqpSettings.MaxFrameSize)
        {
            this.BufferManager      = bufferManager;
            this.MaxLinksPerSession = amqpSettings.MaxLinksPerSession;
            this.address            = address;
            this.onOpened           = onOpened;
            this.transport          = transport;
            transport.SetConnection(this);

            // after getting the transport, move state to open pipe before starting the pump
            if (open == null)
            {
                open = new Open()
                {
                    ContainerId  = amqpSettings.ContainerId,
                    HostName     = amqpSettings.HostName ?? this.address.Host,
                    ChannelMax   = this.channelMax,
                    MaxFrameSize = this.maxFrameSize
                };
            }

            this.SendHeader();
            this.SendOpen(open);
            this.state = State.OpenPipe;
        }
示例#3
0
 internal Connection(IBufferManager bufferManager, AmqpSettings amqpSettings, Address address,
                     IAsyncTransport transport, Open open, OnOpened onOpened, IHandler handler)
     : this(address, DefaultMaxSessions, DefaultMaxFrameSize)
 {
     this.onOpened = onOpened;
     this.handler  = handler;
     this.Init(bufferManager, amqpSettings, transport, open);
 }
 /// <summary>
 /// Constructor to create a connection factory.
 /// </summary>
 public ConnectionFactory()
 {
     this.amqpSettings = new AmqpSettings()
     {
         MaxFrameSize             = (int)Connection.DefaultMaxFrameSize,
         ContainerId              = Guid.NewGuid().ToString(),
         IdleTimeout              = int.MaxValue,
         MaxSessionsPerConnection = 8
     };
 }
 /// <summary>
 /// Constructor to create a connection factory.
 /// </summary>
 public ConnectionFactory()
 {
     this.amqpSettings = new AmqpSettings()
     {
         MaxFrameSize = (int)Connection.DefaultMaxFrameSize,
         ContainerId = Guid.NewGuid().ToString(),
         IdleTimeout = int.MaxValue,
         MaxSessionsPerConnection = 8
     };
 }
 public ConnectionFactory()
 {
     this.amqpSettings = new AmqpSettings()
     {
         MaxFrameSize             = (int)Connection.DefaultMaxFrameSize,
         ContainerId              = Process.GetCurrentProcess().ProcessName,
         IdleTimeout              = int.MaxValue,
         MaxSessionsPerConnection = 8
     };
 }
        /// <summary>
        /// Constructor to create a connection factory.
        /// </summary>
        protected ConnectionFactoryBase()
        {
            this.tcpSettings = new TcpSettings()
            {
                NoDelay = true
            };

            this.amqpSettings = new AmqpSettings()
            {
                MaxFrameSize             = (int)Connection.DefaultMaxFrameSize,
                ContainerId              = "AMQPLite-" + Guid.NewGuid().ToString("N"),
                IdleTimeout              = int.MaxValue,
                MaxSessionsPerConnection = 8
            };
        }
        /// <summary>
        /// Constructor to create a connection factory.
        /// </summary>
        protected ConnectionFactoryBase()
        {
            this.tcpSettings = new TcpSettings()
            {
                NoDelay = true
            };

            this.amqpSettings = new AmqpSettings()
            {
                MaxFrameSize             = (int)Connection.DefaultMaxFrameSize,
                ContainerId              = Process.GetCurrentProcess().ProcessName,
                IdleTimeout              = int.MaxValue,
                MaxSessionsPerConnection = 8
            };
        }
        /// <summary>
        /// Constructor to create a connection factory.
        /// </summary>
        protected ConnectionFactoryBase()
        {
            this.tcpSettings = new TcpSettings()
            {
                NoDelay = true
            };

            this.amqpSettings = new AmqpSettings()
            {
                MaxFrameSize = (int)Connection.DefaultMaxFrameSize,
                ContainerId = Process.GetCurrentProcess().ProcessName,
                IdleTimeout = int.MaxValue,
                MaxSessionsPerConnection = 8
            };
        }
        /// <summary>
        /// Constructor to create a connection factory.
        /// </summary>
        protected ConnectionFactoryBase()
        {
            this.tcpSettings = new TcpSettings()
            {
                NoDelay = true
            };

            this.amqpSettings = new AmqpSettings()
            {
                MaxFrameSize = (int)Connection.DefaultMaxFrameSize,
                ContainerId = "AMQPLite-" + Guid.NewGuid().ToString("N"),
                IdleTimeout = int.MaxValue,
                MaxSessionsPerConnection = 8
            };
        }
示例#11
0
        /// <summary>
        /// Constructor to create a connection factory.
        /// </summary>
        protected ConnectionFactoryBase()
        {
            this.tcpSettings = new TcpSettings()
            {
                NoDelay = true
            };

            this.amqpSettings = new AmqpSettings()
            {
                MaxFrameSize             = (int)Connection.DefaultMaxFrameSize,
                ContainerId              = Connection.MakeAmqpContainerId(),
                IdleTimeout              = int.MaxValue,
                MaxSessionsPerConnection = Connection.DefaultMaxSessions,
                MaxLinksPerSession       = Connection.DefaultMaxLinksPerSession
            };
        }
示例#12
0
        internal Connection(IBufferManager bufferManager, AmqpSettings amqpSettings, Address address,
            IAsyncTransport transport, Open open, OnOpened onOpened)
            : this((ushort)(amqpSettings.MaxSessionsPerConnection - 1), (uint)amqpSettings.MaxFrameSize)
        {
            this.BufferManager = bufferManager;
            this.address = address;
            this.onOpened = onOpened;
            this.maxFrameSize = (uint)amqpSettings.MaxFrameSize;
            this.transport = transport;
            transport.SetConnection(this);

            // after getting the transport, move state to open pipe before starting the pump
            if (open == null)
            {
                open = new Open()
                {
                    ContainerId = amqpSettings.ContainerId,
                    HostName = amqpSettings.HostName ?? this.address.Host,
                    ChannelMax = this.channelMax,
                    MaxFrameSize = this.maxFrameSize
                };
            }

            this.SendHeader();
            this.SendOpen(open);
            this.state = State.OpenPipe;
        }
示例#13
0
 static uint GetMaxFrameSize(AmqpSettings amqpSettings, Open open)
 {
     return(open != null ? open.MaxFrameSize : (uint)amqpSettings.MaxFrameSize);
 }
示例#14
0
 static ushort GetChannelMax(AmqpSettings amqpSettings, Open open)
 {
     return(open != null ? open.ChannelMax : (ushort)(amqpSettings.MaxSessionsPerConnection - 1));
 }