示例#1
0
        void InitializeHost()
        {
            Debug.Assert(Description.Endpoints.Count == 0, "Please do not include endpoints in config. Instead, provide buffer addresses to the constructor");

            Binding binding = new NetNamedPipeBinding();

            binding.SendTimeout = TimeSpan.MaxValue;

            Type[] interfaces = typeof(T).GetInterfaces();
            Debug.Assert(interfaces.Length > 0);

            foreach (Type interfaceType in interfaces)
            {
                if (interfaceType.GetCustomAttributes(typeof(ServiceContractAttribute), false).Length == 1)
                {
                    ServiceBusHelper.VerifyOneway(interfaceType);
                    string address = @"net.pipe://localhost/" + Guid.NewGuid();
                    AddServiceEndpoint(interfaceType, binding, address);
                }
            }
            m_Factory = binding.BuildChannelFactory <IDuplexSessionChannel>();
            m_Factory.Open();
        }
示例#2
0
 static BufferedServiceBusClient()
 {
     ServiceBusHelper.VerifyOneway(typeof(T));
 }
示例#3
0
 static BufferedServiceBusChannelFactory()
 {
     ServiceBusHelper.VerifyOneway(typeof(T));
 }