June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -4,6 +4,7 @@
{{omit from|Maxima}}
{{omit from|ML/I|No sockets}}
{{omit from|Retro}}
{{omit from|SQL PL|It does not listen any port different to the database server and it does not has daemons - No sockets}}
{{omit from|TI-83 BASIC}}
{{omit from|ZX Spectrum Basic|No sockets}}

View file

@ -14,8 +14,8 @@ serve(dispatch w, file s, list colors)
"<body><h1>Goodbye, world!</h1></body></html>\n");
# chrome won't show the page if we close right away. we'll close in 2s.
d_now(d);
d_offset(d, 2, 0);
d.now;
d.offset(2, 0);
w_schedule(w, d, f_close, i);
}
@ -27,7 +27,7 @@ main(void)
file s;
tcpip_listen(s, 8080, 0);
w_watch(w, s, serve, w, s, l_effect("blue", "green", "red", "yellow"));
w_watch(w, s, serve, w, s, list("blue", "green", "red", "yellow"));
w_press(w);
return 0;

View file

@ -0,0 +1,7 @@
require "http/server"
server = HTTP::Server.new(8080) do |context|
context.response.print "Goodbye World"
end
server.listen

View file

@ -0,0 +1,7 @@
my $listen = IO::Socket::INET.new(:listen, :localhost<localhost>, :localport(8080));
loop {
my $conn = $listen.accept;
my $req = $conn.get ;
$conn.print: "HTTP/1.0 200 OK\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\nGoodbye, World!\r\n";
$conn.close;
}

View file

@ -0,0 +1,8 @@
react {
whenever IO::Socket::Async.listen('0.0.0.0', 8080) -> $conn {
whenever $conn.Supply.lines -> $line {
$conn.print: "HTTP/1.0 200 OK\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\nGoodbye, World!\r\n";
$conn.close;
}
}
}

View file

@ -1,6 +0,0 @@
my $sock = IO::Socket::INET.new(:localhost('0.0.0.0'), :localport(8080), :listen);
say "Goodbye Web Server listening on $sock.localhost():$sock.localport()";
while $sock.accept -> $client {
$client.send: "HTTP/1.0 200 OK\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\nGoodbye, World!\r\n";
$client.close;
}