using Thrift.Server;
using Thrift.Transport;
using ThriftService;

internal class Program
{
    private static void Main(string[] args)
    {
        while (true)
        {
            try
            {
                WcsServer wcsServer = new WcsServer();
                WcsThrift.Processor processor = new WcsThrift.Processor(wcsServer);
                TServerTransport serverTransport = new TServerSocket(9091);
                TServer server = new TSimpleServer(processor, serverTransport);
                Console.WriteLine("Starting the server...");
                server.Serve();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
            Console.WriteLine("done.");
        }
    }
}