diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-08 10:12:44 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-08 10:13:10 -0700 |
commit | 3d91759b87636bd81fb71ab937bee31ca543fc68 (patch) | |
tree | 3c3e342584724100378426fa7cfda1534eb543c9 | |
parent | e5360e0611be0cba2bef7fda687fe8efdee2b72a (diff) | |
download | mu-3d91759b87636bd81fb71ab937bee31ca543fc68.tar.gz |
3478
-rw-r--r-- | server-socket.mu | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/server-socket.mu b/server-socket.mu index 71db3e40..8a67b6e6 100644 --- a/server-socket.mu +++ b/server-socket.mu @@ -1,9 +1,12 @@ -# Example of reading from a socket using channels and writing back to it -# directly. Running this file and navigating to <address of server>:8080 -# should result in your browser displaying "SUCCESS!". +# example program: a single-request HTTP server +# listen for connections from clients on a server socket +# when a connection occurs, transfer it to a session socket +# read from it using channels +# write to it directly # -# Unfortunately, the reading implementation has some redundant, inelegant -# code to make up for my lack of insight into Linux's socket internals. +# After running it, navigate to localhost:8080. Your browser should display +# "SUCCESS!" and the server will terminate after one connection. + def main [ local-scope socket:num <- $open-server-socket 8080/port |