コード例 #1
0
        protected override void OnResponseReceiverConnected(object sender, ResponseReceiverEventArgs e)
        {
            using (EneterTrace.Entering())
            {
                // If per client mode then create service stub for connected client.
                if (myServiceFactoryMethod != null)
                {
                    TServiceInterface aServiceInstanceForThisClient = myServiceFactoryMethod();
                    ServiceStub <TServiceInterface> aServiceStub    = new ServiceStub <TServiceInterface>(aServiceInstanceForThisClient, mySerializer);
                    aServiceStub.AttachInputChannel(AttachedDuplexInputChannel);

                    using (ThreadLock.Lock(myPerConnectionServices))
                    {
                        myPerConnectionServices[e.ResponseReceiverId] = aServiceStub;
                    }
                }

                if (ResponseReceiverConnected != null)
                {
                    ResponseReceiverConnected(this, e);
                }
            }
        }