static void Main(string[] args) { _server = new ChattingService(); using (ServiceHost host = new ServiceHost(_server)) { host.Open(); Console.WriteLine("Server is running"); Console.ReadLine(); } }
static void Main(string[] args) { _server = new ChattingService(); // start the server using (System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(_server)) { host.Open(); Console.WriteLine("Server is running..."); Console.ReadLine(); } }
static void Main(string[] args) { _server = new ChattingService(); using (ServiceHost host = new ServiceHost(_server)) { host.Open(); Console.WriteLine("Server is running..."); Console.ReadLine(); host.Close(); } }
static void Main(string[] args) { try { _server = new ChattingService(); using (ServiceHost host = new ServiceHost(_server)) { host.Open(); Console.WriteLine("Server is running...."); Console.ReadLine(); } } catch (CommunicationException ce) { Console.WriteLine("An exception occurred: {0}", ce.Message); } }