Skip to content

Commit

Permalink
Merge pull request #13 from savi-lang/update/latest-tcp-engine
Browse files Browse the repository at this point in the history
Update example to latest TCP library usage.
  • Loading branch information
jemc authored Feb 15, 2023
2 parents 2afe70e + 7db5e8e commit 9941531
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions examples/simple/src/Main.savi
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,17 @@
:fun ref io_react(action IO.Action)
case action == (
| IO.Action.Read |
@io.pending_reads -> (data |
try (
request = @reader.read!(@io.read_stream)
try (
request = @reader.read!(@io.read_stream)

response = HTTPServer.ResponseBuilder.new(@io.write_stream)
response = HTTPServer.ResponseBuilder.new(@io.write_stream)

response
.status_ok
.header("Content-Length", "0")
.finish
response
.status_ok
.header("Content-Length", "0")
.finish

try @io.flush!
)
try @io.flush!
)
| IO.Action.Write |
try @io.flush!
Expand Down

0 comments on commit 9941531

Please sign in to comment.