private static void StartService() { ServiceHost host = new ServiceHost(); host.AddService(new HelloWorldService()); host.StartServiceHost(); host.OpenServices(); Console.WriteLine("Press enter to stop server"); Console.ReadLine(); host.CloseServices(); host.StopServiceHost(); }
private static void StartChatRoomServer(ChatroomSettings settings) { ServiceHost host = new ServiceHost(); host.AddService(new ChatroomService(settings)); host.StartServiceHost(); host.OpenServices(); Console.WriteLine("Type \"quit\" to shut down server"); string input = null; do { input = Console.ReadLine(); Console.WriteLine(input); //TODO: Implement Console Commands } while (input != "quit"); host.CloseServices(); host.StopServiceHost(); }