def connect

bend-kit-websocket@0.4.0.0 · websocket.bend:926

import bend-kit-websocket@0.4.0.0/websocket.bend as Websocket
import Base
import bend-kit-wire@0.4.6.2/wire.bend as Wire

926# ws:// (tls false) or wss:// to a numeric address (resolve names with dns). host is the
927# server name, for Host and TLS verification. ms bounds each socket step.
928def connect(+addr: String, +port: U32, +host: String, +path: String, +tls: Bool, +max: U32, +ms: U32) -> IO(Result<&1, &1, U32 & String, Conn>):
929  +std = U32.is_eq(port, Bool.pick(U32, tls, 443, 80))
930  +authority = Bool.pick(String, std, host, host ++ ":" ++ U32.show(port))
931  do IO<Result<&1, &1, U32 & String, Conn>>:
932    c : Result<&1, &1, U32 & String, Socket> <- Wire.connect(addr, port, ms)
933    connect.tcp(c, tls, host, authority, path, max, ms)

Uses (15)

Used by (0)

No other definition uses this definition.