diff --git a/anubis_dev/library/examples/client_server.anubis b/anubis_dev/library/examples/client_server.anubis index 738d3e3..25c3336 100644 --- a/anubis_dev/library/examples/client_server.anubis +++ b/anubis_dev/library/examples/client_server.anubis @@ -27,9 +27,6 @@ connect predefined.anubis - This program is deliberately minimalist. However, it may serve as a basis for - constructing an instant messaging system, with pseudonyms, centralized server, etc... - *** Description. @@ -67,11 +64,11 @@ define One // "From 127.0.0.1:12345: ") ) = if *connection is // read one byte from the connection - // (the handler waits for the next byte or the connection + // (this expression waits for the next byte or the connection // is closed by the client) { failure then // the connection has been closed by the client - print(from+" Connection closed by client.\n"), + print(from+"Connection closed by client.\n"), success(c) then // the byte 'c' has been read if c = '\n' @@ -144,7 +141,7 @@ global define One if args is { [ ] then server_syntax, - [h . t] then + [h . _] then if string_to_integer(h) is { failure then server_syntax, @@ -155,10 +152,9 @@ global define One (One u) |-> u) is { cannot_create_the_socket then print("Cannot create the socket for listening.\n"), - cannot_bind_to_port then print("Cannot bind to port "+h+"\n"), - cannot_listen_on_port then print("Cannot listen on port "+h+"\n"), - ok(server) then print("Simple Server started on port "+h+"\n") - + cannot_bind_to_port then print("Cannot bind to port "+h+".\n"), + cannot_listen_on_port then print("Cannot listen on port "+h+".\n"), + ok(server) then print("Simple Server started on port "+h+".\n") } } }. @@ -194,7 +190,7 @@ define One within the program. It is exited only when 'anbexec' (of the client) is stopped by a [Ctrl C]. Also notice that we must not forget to send "\n" appended to the text. Otherwise, the server will wait indefinitely for the end of the line, and will - print nothing. This "\n" is part of our 'transmission protocol'. + print nothing. This "\n" is part of our 'simple transmission protocol'. The client program requires an IP address and port number in order to be able to find -- libgit2 0.21.4