static void Main(string[] args) { if (!args.Any()) { MainClient(); return; } RiverInit.RegAll(); _timer = new Timer(Tick, null, 1000, 1000); // ObjectTracker.TypesToPrint.Add(typeof(Handler)); var server1 = new SocksServer { Chain = { // "ss://*****:*****@127.0.0.1:8338", }, }; server1.Run("socks://0.0.0.0:1080"); /* * var server2 = new ShadowSocksServer * { * Chain = * { * // "ss://*****:*****@127.0.0.1:8338", * }, * }; * server2.Run("ss://*****:*****@0.0.0.0:8338"); */ string q; do { q = Console.ReadLine(); GC.Collect(); GC.WaitForPendingFinalizers(); GC.WaitForFullGCApproach(); foreach (var item in ObjectTracker.Default.Get <Thread>()) { Console.WriteLine(Stringify.ToString(item, true)); } } while (q != "q"); }
public static void ClassInit(TestContext ctx) { Resolver.RegisterOverride("_river", x => new RiverSelfService()); _proxyPort = GetFreePort(); _server = new SocksServer(); _server.Run(new ServerConfig { EndPoints = { new IPEndPoint(IPAddress.Loopback, _proxyPort), new IPEndPoint(IPAddress.IPv6Loopback, _proxyPort), }, }); // ObjectTracker.Default.ResetCollection(); }