Anonymous user
Hello world/Web server: Difference between revisions
→{{header|D}}, cast to bool for listener accept is no longer vaild D, use !is null test instead
Line 471:
=={{header|D}}==
Using sockets only, also shows use of heredoc syntax
''If you copy from this page, be careful with extraneous spaces on the empty lines in the heredoc''.
<lang D>import std.socket, std.array;
ushort port = 8080;
Line 486 ⟶ 485:
Socket currSock;
while (
currSock.sendTo(replace(q"EOF
HTTP/1.1 200 OK
Line 492 ⟶ 491:
<html>
<head><title>Hello
<body>
</html>
EOF", "\n", "\r\n"));
|