def step.socket
import gralha-http-server@0.1.0.0/server.bend as Serverimport Base
import gralha-http-core@0.1.0.0/http.bend as Http
138# As step, but reply(socket)(request)(state) answers on the socket itself
139# and must close it: for bodies the app streams through its own effect.
140def step.socket(~S: Type, ~reply: Socket -> Http.Request -> S -> IO(S),
141 listener: Listener, state: S, +max: U32) -> IO(Listener & S):
142 do IO<Listener & S>:
143 got : Listener & Result<&1, &1, U32 & String, Socket> <- TCP.accept(listener)
144 accepted.socket(~S, ~reply, got, state, max)