[server] Bugfix: Actually start the TcpListener

This commit is contained in:
Starbeamrainbowlabs 2016-11-17 19:19:46 +00:00
parent 9e19127699
commit 9569e2c59b

View file

@ -99,11 +99,13 @@ namespace PixelHub.Server
public async Task Listen() public async Task Listen()
{ {
server = new TcpListener(Endpoint); server = new TcpListener(Endpoint);
server.Start();
logger.WriteLine("TCP Listener set up on {0}.", Endpoint); logger.WriteLine("TCP Listener set up on {0}.", Endpoint);
Active = true; Active = true;
while(true) while(true)
{ {
TcpClient nextClient = await server.AcceptTcpClientAsync(); TcpClient nextClient = await server.AcceptTcpClientAsync();
Console.WriteLine("Got connection");
AsyncTools.ForgetTask(Handle(nextClient)); AsyncTools.ForgetTask(Handle(nextClient));
} }
// TODO: Add an shutdown CancellationToken thingy here // TODO: Add an shutdown CancellationToken thingy here