Ejemplo n.º 1
0
        public Sender(string name, bool useDedicatedThread, TimeSpan delay)
        {
            this.name = name;
            NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);

            this.factory            = binding.BuildChannelFactory <IDuplexSessionChannel>();
            this.useDedicatedThread = useDedicatedThread;
            this.delay = delay;
        }
Ejemplo n.º 2
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();
        }