Exemplo n.º 1
0
        internal void OnDupHandle(ListenerSessionConnection session)
        {
            if (DiagnosticUtility.ShouldTraceInformation)
            {
                ListenerTraceUtility.TraceEvent(TraceEventType.Information, ListenerTraceCode.TransportListenerSessionsReceived, SR.GetString(SR.TraceCodeTransportListenerSessionsReceived), this);
            }

            if (TD.TransportListenerSessionsReceivedIsEnabled())
            {
                TD.TransportListenerSessionsReceived(session.EventTraceActivity, session.Via.ToString());
            }

            IPAddress     address;
            int           port;
            TransportType transportType = GetTransportTypeAndAddress(session.Connection, out address, out port);

            Debug.Print("TransportListener.OnDupHandle() via: " + session.Via.ToString() + " transportType: " + transportType);
            MessageQueue messageQueue = RoutingTable.Lookup(session.Via, address, port);

            if (messageQueue != null)
            {
                messageQueue.EnqueueSessionAndDispatch(session);
            }
            else
            {
                TransportListener.SendFault(session.Connection, FramingEncodingString.EndpointNotFoundFault);
                MessageQueue.OnDispatchFailure(transportType);
            }
        }
Exemplo n.º 2
0
        bool IConnectionRegister.ValidateUriRoute(Uri uri, System.Net.IPAddress address, int port)
        {
            if (this.queue == null)
            {
                AbortServiceInstance();
                return(false);
            }

            MessageQueue destinationQueue = RoutingTable.Lookup(uri, address, port);

            return(object.ReferenceEquals(destinationQueue, this.queue));
        }