diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-22 00:40:59 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-22 00:40:59 -0700 |
commit | 4543a0dda5843c0a7af6a51462ecf3d7af63b5ce (patch) | |
tree | b2fc128e285012ad1c3f150d6ca9dc20bd31c0c0 | |
parent | 25cd8e9878b7b7325271773d4e4ec91b7462d0e6 (diff) | |
download | mu-4543a0dda5843c0a7af6a51462ecf3d7af63b5ce.tar.gz |
3404
-rw-r--r-- | server-socket.mu | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server-socket.mu b/server-socket.mu index 3da870ca..3538b687 100644 --- a/server-socket.mu +++ b/server-socket.mu @@ -1,15 +1,15 @@ # Example of reading from a socket using channels and writing back to it -# directly. Running this file and navigating to <address of server>:8081 +# directly. Running this file and navigating to <address of server>:8080 # should result in your browser displaying "SUCCESS!". # # Unfortunately, the reading implementation has some redundant, inelegant -# code to make up for my lack of insight into Linux's socket internal. +# code to make up for my lack of insight into Linux's socket internals. def main [ local-scope - socket:num <- $socket 8081/port + socket:num <- $socket 8080/port $print [Mu socket creation returned ], socket, 10/newline session:num <- $accept socket - contents:&:source:char, sink:&:sink:char <- new-channel 5096 + contents:&:source:char, sink:&:sink:char <- new-channel 30 sink <- start-running transmit-from-socket session, sink buf:&:buffer <- new-buffer 30 { @@ -50,7 +50,7 @@ def transmit-from-socket session:num, sink:&:sink:char -> sink:&:sink:char [ local-scope load-ingredients { - req:text, bytes-read:number <- $read-from-socket session, 4096/bytes + req:text, bytes-read:number <- $read-from-socket session, 4096/bytes $print [read ], bytes-read, [ bytes from socket], 10/newline i:number <- copy 0 { |