Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net.recvFrom address is always "0.0.0.0" for ipv6 #7634
import net var socket = newSocket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP) socket.bindAddr(Port(1900), "::") var data: string = "" address: string = "" port: Port while true: echo "R: ", socket.recvFrom(data, 1024, address, port ), " ", address,":", port, " " , data # now send to it `echo "test" | ncat -u -6 "::1" 1900` # R: 5 0.0.0.0:48147 test
It seems to be the case that (at least on linux) it depends on the address you bound to
So if you bound to an ipv6 address: every incoming connection (even if it connects to your ipv4 address, and comes from ipv4) has AF_INET6 set.
It seemd to be mapped to ipv6?