1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net: ipv6 support, merge unix+ip;[pack:x] attribute (#9904)

This commit is contained in:
Emily Hudson
2021-06-13 21:53:38 +01:00
committed by GitHub
parent fa9fa77a5f
commit 535dcac8fa
52 changed files with 1277 additions and 524 deletions

24
examples/net_resolve.v Normal file
View File

@ -0,0 +1,24 @@
import net
for addr in [
'vlang.io:80',
'google.com:80',
'steampowered.com:80',
'api.steampowered.com:80',
] {
println('$addr')
for @type in [net.SocketType.tcp, .udp] {
family := net.AddrFamily.unspec
addrs := net.resolve_addrs(addr, family, @type) or {
println('> None')
continue
}
for a in addrs {
f := a.family()
println('> $a $f ${@type}')
}
}
}