def wire.dial

emerging-ezhttp@0.21.0.0 · src/wire.bend:211

import emerging-ezhttp@0.21.0.0/src/wire.bend as Wire
import Base
import bend-kit-wire@0.4.6.1/wire.bend as W

211# connect to each address in turn until one connects; the last one's
212# failure when none does
213def wire.dial(rest: List<&2, String>, +first: String, +port: U32, +ms: U32)
214  -> IO(Result<&1, &1, U32 & String, Socket>):
215  match rest:
216    case []:
217      W.connect(first, port, ms)
218    case ip <> t:
219      IO.bind(Result<&1, &1, U32 & String, Socket>,
220        Result<&1, &1, U32 & String, Socket>,
221        W.connect(first, port, ms),
222        r => wire.dial.next(r, _u => wire.dial(t, ip, port, ms)))

Uses (10)

Used by (1)