v / examples
Raw file | 24 loc (20 sloc) | 390 bytes | Latest commit hash 017ace6ea
1import net
2
3for addr in [
4 'vlang.io:80',
5 'google.com:80',
6 'steampowered.com:80',
7 'api.steampowered.com:80',
8] {
9 println('${addr}')
10
11 for @type in [net.SocketType.tcp, .udp] {
12 family := net.AddrFamily.unspec
13
14 addrs := net.resolve_addrs(addr, family, @type) or {
15 println('> None')
16 continue
17 }
18
19 for a in addrs {
20 f := a.family()
21 println('> ${a} ${f} ${@type}')
22 }
23 }
24}