using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Dispatcher;
using ContosoPizzaLibraryV2;

namespace ContosoServiceHostV2
{
    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost(typeof(PizzaServiceV2));
            host.Open();

            Console.WriteLine("****** V2 PizzaService *****\n");
            Console.WriteLine("{0} is up and running with these listeners:", host.Description.ServiceType);
            foreach (ChannelDispatcher cd in host.ChannelDispatchers)
                Console.WriteLine(cd.Listener.Uri);
            Console.WriteLine();

            Console.ReadLine();
            host.Close();
        }
    }
}
