def try.sent

bend-kit-dns@0.7.0.0 · dns.bend:457

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

457# §4.2.1 and resolv.conf defaults: 5 s per attempt.
458def try.sent(ns: String, id: U32, m: Socket & Result<&1, &1, U32 & String, Unit>) -> IO(Socket & Try):
459  (s, r) = m
460  match r:
461    case Fail{e}:
462      try.pure(s, Again{})
463    case Done{u}:
464      do IO<Socket & Try>:
465        back : Socket & Result<&1, &1, U32 & String, String & U32 & (U32 & Array<U32>)> <- Wire.recv_from.words(s, 512, 5000)
466        try.back(ns, id, back)

Uses (14)

Used by (1)