static void Main(string[] args) { Console.WriteLine("Using LAMX Distruptor With WCF - Consumer"); Console.WriteLine(); TSingleton <MP1CSequencingBuffer <Byte[]> > .Instance.SetUp( Settings.Messaging.DefaultMessageStoreBufferSize, ByteArrayItemFactory.Create); TSingleton <MP1CSequencingBuffer <Byte[]> > .Instance.NewEntryAdded += TSingleton <ByteArrayItemProcessor> .Instance.Process; NetTcpBinding netTcpBinding = new NetTcpBinding(SecurityMode.None); ServiceHost messageQueueHost = new ServiceHost(typeof(Service)); messageQueueHost.AddServiceEndpoint(typeof(IService), netTcpBinding, Settings.Communincation.TCPURI); messageQueueHost.AddDefaultMEXEndPoint(); messageQueueHost.EnableIncludeExceptionInFaultBehavior(); messageQueueHost.Open(); Console.WriteLine(messageQueueHost.GetHostedServiceEndPoints()); Console.WriteLine("Service Host Running..."); Console.WriteLine("Press <ENTER> to stop Service Host"); Console.ReadLine(); messageQueueHost.Close(); TSingleton <MP1CSequencingBuffer <Byte[]> > .Instance.NewEntryAdded -= TSingleton <ByteArrayItemProcessor> .Instance.Process; TSingleton <MP1CSequencingBuffer <Byte[]> > .Instance.Dispose(); }
private ServiceHost CreateHost() { NetNamedPipeBinding netNamedPipeBinding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); ServiceHost eventServiceHost = new ServiceHost(typeof(EventService)); eventServiceHost.AddServiceEndpoint(typeof(IEventService), netNamedPipeBinding, Config.Communincation.ServiceURI); eventServiceHost.AddDefaultMEXEndPoint(); eventServiceHost.EnableIncludeExceptionInFaultBehavior(); return eventServiceHost; }