def accept_pump

cswap-bend-cli@0.1.0.0 · server.bend:181

import cswap-bend-cli@0.1.0.0/server.bend as Server
import Base
import cswap-bend-cli@0.1.0.0/fmt/out.bend as O

181@unsafe def accept_pump(p: AP, +fmt: O.Fmt) -> IO(Unit):
182  match p:
183    case AAcc{l}:
184      IO.bind(Listener & Result<&1, &1, U32 & String, Socket>, Unit, TCP.accept(l), r => accept_pump(after_accept(r), fmt))
185    case AConn{l, s}:
186      IO.bind(Unit, Unit, conn_pump(CRecv{s, ""}, fmt), u => accept_pump(AAcc{l}, fmt))
187    case ARetry{l}:
188      IO.bind(Unit, Unit, IO.sleep(100), u => accept_pump(AAcc{l}, fmt))

Uses (16)

Used by (1)