[server] Bugfix: Actually start the TcpListener
This commit is contained in:
parent
9e19127699
commit
9569e2c59b
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Reference in a new issue