Пример #1
0
        internal void Init()
        {
            errorBehavior = new ErrorBehavior(this);

            filterTable = new EndpointDispatcherTable(ThisLock);
            for (int i = 0; i < endpointDispatchers.Count; i++)
            {
                EndpointDispatcher endpoint = endpointDispatchers[i];

                // Force a build of the runtime to catch any unexpected errors before we are done opening.
                endpoint.DispatchRuntime.GetRuntime();
                // Lock down the DispatchRuntime.
                endpoint.DispatchRuntime.LockDownProperties();

                filterTable.AddEndpoint(endpoint);

                if ((addressTable != null) && (endpoint.OriginalAddress != null))
                {
                    addressTable.Add(endpoint.AddressFilter, endpoint.OriginalAddress, endpoint.FilterPriority);
                }

                //if (DiagnosticUtility.ShouldTraceInformation)
                //{
                //    this.TraceEndpointLifetime(endpoint, TraceCode.EndpointListenerOpen, SR.Format(SR.TraceCodeEndpointListenerOpen));
                //}
            }
        }
Пример #2
0
 public ServiceDispatcher(Uri baseAddress, Binding binding, EndpointDispatcherTable endpointDispatcherTable)
 {
     BaseAddress = baseAddress;
     Binding     = binding;
     _endpointDispatcherTable = endpointDispatcherTable;
     // TODO: Maybe make lazy
     _requestReplyCorrelator = new RequestReplyCorrelator();
 }
Пример #3
0
        private void OnRemoveEndpoint(EndpointDispatcher endpoint)
        {
            lock (ThisLock)
            {
                if (State == CommunicationState.Opened)
                {
                    EndpointDispatcherTable.RemoveEndpoint(endpoint);
                }

                endpoint.Detach(this);
            }
        }
Пример #4
0
        private void OnAddEndpoint(EndpointDispatcher endpoint)
        {
            lock (ThisLock)
            {
                endpoint.Attach(this);

                if (State == CommunicationState.Opened)
                {
                    EndpointDispatcherTable.AddEndpoint(endpoint);
                }
            }
        }