def h2.send.one

bend-kit-http@0.38.2.0 · http.bend:3281

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-wire@0.4.7.0/wire.bend as Wire
import bend-kit-bytes@0.3.3.0/bytes.bend as HBytes

3281def h2.send.one(prev: Result<&1, &1, Err, Socket>, b: HBytes.Bytes) ->
3282    IO(Result<&1, &1, Err, Socket>):
3283  match prev:
3284    case Fail{e}:
3285      IO.pure(Result<&1, &1, Err, Socket>, Fail{e})
3286    case Done{s}:
3287      HBytes.Bytes{len, buf} = b
3288      do IO<Result<&1, &1, Err, Socket>>:
3289        sent : Socket & Result<&1, &1, U32 & String, Unit> <- Wire.tls.send.words(s, len, buf)
3290        h2.send.report(sent)

Uses (13)

Used by (1)