Пример #1
0
 public Listener(Container container)
 {
     this.container = container;
     this.connections = new List<AmqpConnection>();
     this.settings = new AmqpSettings() { RuntimeProvider = this };
     TransportProvider provider = new AmqpTransportProvider();
     provider.Versions.Add(new AmqpVersion(1, 0, 0));
     this.settings.TransportProviders.Add(provider);
     this.nodes = new Dictionary<string, List<LinkAsyncResult>>(StringComparer.OrdinalIgnoreCase);
     this.syncRoot = new object();
 }
Пример #2
0
 public Subscriber(Container container, string node)
     : base(container, node)
 {
     this.messages = new InputQueue<AmqpMessage>();
 }
Пример #3
0
 protected Terminus(Container container, string node)
 {
     this.container = container;
     this.node = node;
 }
Пример #4
0
 public Publisher(Container container, string node)
     : base(container, node)
 {
     this.sender = new SerializedWorker<AmqpMessage>(this.OnSend, null, false);
 }
Пример #5
0
            public OpenContainerAsyncResult(Container parent, AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.parent = parent;

                int port = this.parent.addressUri.Port;
                if (port == -1)
                {
                    port = AmqpConstants.DefaultPort;
                }

                TcpTransportSettings tcpSettings = new TcpTransportSettings();
                tcpSettings.TcpBacklog = 20;
                tcpSettings.TcpBufferSize = 4096;
                tcpSettings.SetEndPoint(this.parent.addressUri.Host, port, false);
                TransportSettings transportSettings = tcpSettings;

                TransportInitiator initiator = transportSettings.CreateInitiator();
                TransportAsyncCallbackArgs args = new TransportAsyncCallbackArgs();
                args.CompletedCallback = onTransport;
                args.UserToken = this;
                if (!initiator.ConnectAsync(TimeSpan.MaxValue, args))
                {
                    OnTransport(args);
                }
            }