using System; using System.Net; using System.Threading.Tasks; using SBRL.Utilities; using PixelServer.Net; namespace PixelServer { static class Program { private static int port = 5050; private static PrefixedWriter systemWriter = new PrefixedWriter(Console.Out) { Prefix = "[System] " }; private static PrefixedWriter beaconWriter = new PrefixedWriter(Console.Out) { Prefix = "[Beacon] " }; private static PrefixedWriter serverWriter = new PrefixedWriter(Console.Out) { Prefix = "[Server] " }; public static void Main(string[] args) { systemWriter.WriteLine("Booting server."); DiscoveryBeacon beacon = new DiscoveryBeacon( IPAddress.Parse("239.62.148.30"), port, beaconWriter ); PixelServer server = new PixelServer(port, serverWriter); systemWriter.WriteLine("Server booting complete. Beginning async loop."); //AsyncTools.ForgetTask(beacon.Emit()); Task.WaitAll(new Task[] { beacon.Emit(), server.Listen() }); } } }