OxL Reference

method SocketAddr.of

The address ip:port.

Example:

oxl✓ checked in CI
use std.net { SocketAddr, IpAddr }

fn main() io {
  print(SocketAddr.of(IpAddr.loopback(), 8080).toString())
}
Output
127.0.0.1:8080
pub(api) static fn of(ip: IpAddr, port: u16) -> SocketAddr

Since. 1.0.0-beta

Parameters

NameType
ipIpAddr
portu16

Returns

SocketAddr

Effects

none declared (pure unless the body says otherwise)

Defined in: std/net/net.oxl:312

See also