mirror of
https://github.com/besterprotocol/besterd
synced 2023-12-13 21:00:32 +01:00
Create server with hardcoded AF_INET4 bind address and TCP port
This commit is contained in:
parent
7f41ab4f71
commit
e53fd120ed
2 changed files with 14 additions and 2 deletions
|
@ -1,9 +1,13 @@
|
|||
module app;
|
||||
|
||||
import std.stdio;
|
||||
import server.server;
|
||||
import server.types;
|
||||
|
||||
void main()
|
||||
{
|
||||
writeln("Edit source/app.d to start your project.");
|
||||
/* TODO: Change this */
|
||||
string address = "0.0.0.0";
|
||||
ushort port = 2222;
|
||||
|
||||
BesterServer server = new BesterServer(address, port);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
module server.types;
|
||||
|
||||
import utils.debugging : debugPrint;
|
||||
import std.conv : to;
|
||||
|
||||
public class BesterServer
|
||||
{
|
||||
|
||||
this(string bindAddress, ushort listenPort)
|
||||
{
|
||||
debugPrint("Binding to address: " ~ bindAddress ~ " and port " ~ to!(string)(listenPort));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue