def try.send
bend-kit-dns@0.7.0.0 · dns.bend:468
import bend-kit-dns@0.7.0.0/dns.bend as Dns
import Base
import bend-kit-wire@0.4.6.2/wire.bend as Wire
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
468
469def try.send(s: Socket, +ns: String, id: U32, q: Maybe<&1, Bytes.Bytes>) -> IO(Socket & Try):
470 match q:
471 case None{}:
472 try.pure(s, Got{None{}})
473 case Some{Bytes.Bytes{n, w}}:
474 do IO<Socket & Try>:
475 sent : Socket & Result<&1, &1, U32 & String, Unit> <- Wire.send_to.words(s, ns, 53, n, w)
476 try.sent(ns, id, sent)