using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace StarTrinity
{
	class CentralProxyTesterProgram
	{
		static void Main(string[] args)
		{
			try
			{
				var p = new CentralProxyMainService();
				var dps = new List<DistributedProxy>();
				for (int i = 0; i < 100; i++) dps.Add(new DistributedProxy(new DistributedProxySettings()));
				
				Console.WriteLine("central proxy server is working. press <enter> to stop");
				Console.ReadLine();

				Console.WriteLine("disposing proxy servers");
				p.Dispose();
				foreach (var dp in dps) dp.Dispose();
				Console.WriteLine("disposed proxy servers");
			}
			catch (Exception exc)
			{
				Console.WriteLine("error: " + exc.ToString());
			}
		}
	}
}
