def reply.sent.close

bend-kit-http@0.38.5.0 · http.bend:5609

import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-time@0.3.0.0/time.bend as Time

5609def reply.sent.close(m: Socket & Result<&1, &1, U32 & String, Unit>) -> IO(Unit):
5610  (s, r) = m
5611  match r:
5612    case Fail{e}:
5613      Socket.close(s)
5614    case Done{u}:
5615      do IO<Unit>:
5616        now : Time.Duration <- Time.mono()
5617        reply.drain(U32.to_nat(512), True{}, Time.Duration.add(now, Time.Duration.of_ms(2500)), (s, True{}))

Uses (17)

Used by (1)