internal override void OnOpen(TimeSpan timeout) { MessagingClientEtwProvider.TraceClient(() => MessagingClientEtwProvider.Provider.EventWriteAmqpLogOperation(this, TraceOperation.Open, this.ListenUri)); this.amqpTransportListener = this.CreateTransportListener(); this.amqpTransportListener.Closed += new EventHandler(this.OnAmqpTransportListenerClosed); this.amqpTransportListener.Open(timeout); this.amqpTransportListener.Listen(new Action <TransportAsyncCallbackArgs>(this.OnAcceptTransport)); this.IsOpen = true; }
internal override void OnClose(TimeSpan timeout) { this.IsOpen = false; MessagingClientEtwProvider.TraceClient(() => MessagingClientEtwProvider.Provider.EventWriteAmqpLogOperation(this, TraceOperation.Close, this.ListenUri)); AmqpTransportListener amqpTransportListener = this.amqpTransportListener; if (amqpTransportListener != null) { amqpTransportListener.Closed -= new EventHandler(this.OnAmqpTransportListenerClosed); amqpTransportListener.Close(timeout); } }
/// <summary> /// Initializes a listener. /// </summary> /// <param name="addresses">The addresses to listen on.</param> /// <param name="settings">The protocol settings of the listener.</param> /// <param name="connectionSettings">The connection settings applied to accepted connections.</param> public AmqpConnectionListener(IEnumerable <string> addresses, AmqpSettings settings, AmqpConnectionSettings connectionSettings) { if (settings.RuntimeProvider == null) { throw new ArgumentNullException("IRuntimeProvider"); } this.runtime = settings.RuntimeProvider; this.connectionSettings = connectionSettings; this.connections = new HashSet <AmqpConnection>(); this.onConnectionClosed = this.OnConnectionClosed; this.listener = CreateListener(addresses, settings); }
/// <summary> /// Called when an insecure transport is accepted. /// </summary> /// <param name="listener">The listener that accepted the transport.</param> /// <param name="transport">The accepted transport.</param> /// <param name="isSecure">true if the transport is encrypted, or false otherwise.</param> /// <param name="isAuthenticated">true if the transport is authenticated, or false otherwise.</param> public virtual void AmqpInsecureTransport(AmqpTransportListener listener, TransportBase transport, bool isSecure, bool isAuthenticated) { }