This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
PixelHub/PixelHub-Server/PixelHub/Program.cs.orig

34 lines
984 B
C#

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()
});
}
}
}