void main() { const int port = 8080;
auto server = new ServerSocket (new IPv4Address(port)); Cout("server started"); while (true ) { // wait for requests auto request = server.accept; // write a response request.output.write ("server replies 'hello'"); request.close; } }