diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-12-03 23:25:40 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-12-03 23:25:40 -0800 |
commit | 4a48bedcd1d708a43d43dc6259a4e45c52ea3d00 (patch) | |
tree | 85c1b7310cca932797d727a3de8da96eb175d8da /092socket.mu | |
parent | ef7d834fdd826977cd8d43253052a7b8e1c5aa72 (diff) | |
download | mu-4a48bedcd1d708a43d43dc6259a4e45c52ea3d00.tar.gz |
4134 - 'input' = 'ingredient'
Diffstat (limited to '092socket.mu')
-rw-r--r-- | 092socket.mu | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/092socket.mu b/092socket.mu index 1cf6930a..be4e5bb2 100644 --- a/092socket.mu +++ b/092socket.mu @@ -25,7 +25,7 @@ F - example-server-test: $open-server-socket failed] # helper just for this scenario def example-handler query:text -> response:text [ local-scope - load-ingredients + load-inputs return [abc] ] @@ -54,7 +54,7 @@ type request-handler = (recipe text -> text) def serve-one-request socket:num, request-handler:request-handler -> socket:num [ local-scope - load-ingredients + load-inputs session:num <- $accept socket assert session, [ F - example-server-test: $accept failed] @@ -68,9 +68,9 @@ F - example-server-test: $accept failed] def start-reading-from-network resources:&:resources, uri:text -> contents:&:source:char [ local-scope - load-ingredients + load-inputs { - port:num, port-found?:boolean <- next-ingredient + port:num, port-found?:boolean <- next-input break-if port-found? port <- copy 80/http-port } @@ -92,7 +92,7 @@ def start-reading-from-network resources:&:resources, uri:text -> contents:&:sou def request-socket socket:num, s:text -> socket:num [ local-scope - load-ingredients + load-inputs write-to-socket socket, s $write-to-socket socket, 13/cr $write-to-socket socket, 10/lf @@ -103,7 +103,7 @@ def request-socket socket:num, s:text -> socket:num [ def receive-from-socket socket:num, sink:&:sink:char -> sink:&:sink:char, socket:num [ local-scope - load-ingredients + load-inputs { +next-attempt c:char, found?:bool, eof?:bool, error:num <- $read-from-socket socket @@ -124,14 +124,14 @@ def receive-from-socket socket:num, sink:&:sink:char -> sink:&:sink:char, socket def receive-from-client-socket-and-close socket:num, sink:&:sink:char -> sink:&:sink:char, socket:num [ local-scope - load-ingredients + load-inputs sink <- receive-from-socket socket, sink socket <- $close-socket socket ] def write-to-socket socket:num, s:text [ local-scope - load-ingredients + load-inputs len:num <- length *s i:num <- copy 0 { @@ -147,7 +147,7 @@ def write-to-socket socket:num, s:text [ # like split-first, but don't eat the delimiter def split-at text:text, delim:char -> x:text, y:text [ local-scope - load-ingredients + load-inputs # empty text? return empty texts len:num <- length *text { |