Server.step: def of gralha-http-server@0.1.0.0 Import: import gralha-http-server@0.1.0.0/server.bend as Server Lines 129-136 of gralha-http-server@0.1.0.0/server.bend: https://jend.leeeet.dev/read.txt?path=gralha-http-server@0.1.0.0/server.bend&start_line=129&end_line=136 import Base import gralha-http-core@0.1.0.0/http.bend as Http # Accepts one connection, reads its request (up to max bytes), answers it # with handle(request)(state) and closes it; a request that never parses # gets a 400. A failed accept leaves the state as it was. def step(~S: Type, ~handle: Http.Request -> S -> IO(S & Http.Response), listener: Listener, state: S, +max: U32) -> IO(Listener & S): do IO: got : Listener & Result<&1, &1, U32 & String, Socket> <- TCP.accept(listener) accepted(~S, ~handle, got, state, max) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Listener https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Socket https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=TCP.accept https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=Request https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=Response https://jend.leeeet.dev/definition.txt?path=gralha-http-server@0.1.0.0/server.bend&name=accepted