besterd/source/server/server.d

22 lines
425 B
D
Raw Normal View History

2020-04-16 15:02:34 +02:00
module server.server;
import server.types;
2020-04-16 16:50:57 +02:00
import std.conv : to;
import std.socket : SocketOSException;
import utils.debugging : debugPrint;
2020-04-16 15:02:34 +02:00
2020-04-16 16:39:31 +02:00
void startServer(string address, ushort port)
2020-04-16 15:02:34 +02:00
{
2020-04-16 16:50:57 +02:00
BesterServer server = null;
try
{
server = new BesterServer(address, port);
server.run();
}
catch(SocketOSException exception)
{
debugPrint("Error binding to address " ~ address ~ " and port " ~ to!(string)(port));
}
2020-04-16 15:02:34 +02:00
}