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/PixelServer/Program.cs

35 lines
984 B
C#
Raw Normal View History

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