示例#1
0
 void IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase)
 {
     serviceHostBase.Closed += delegate
     {
         ThreadAffinityHelper.CloseThread(m_ServiceType);
     };
 }
示例#2
0
        public CallbackThreadAffinityBehaviorAttribute(Type clientType, string threadName)
        {
            m_ThreadName = threadName;
            m_ClientType = clientType;

            AppDomain.CurrentDomain.ProcessExit += delegate
            {
                ThreadAffinityHelper.CloseThread(m_ClientType);
            };
        }
示例#3
0
 void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime)
 {
     m_ThreadName = m_ThreadName ?? "Executing callbacks of " + m_ClientType;
     ThreadAffinityHelper.ApplyDispatchBehavior(m_ClientType, m_ThreadName, clientRuntime.CallbackDispatchRuntime);
 }
示例#4
0
 void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
 {
     m_ThreadName = m_ThreadName ?? "Executing endpoints of " + m_ServiceType;
     ThreadAffinityHelper.ApplyDispatchBehavior(m_ServiceType, m_ThreadName, dispatchRuntime);
 }