Closed alfredh closed 5 months ago
Process completed with exit code 10014.
Means: WSAEFAULT
The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a [sockaddr](https://learn.microsoft.com/en-us/windows/desktop/winsock/sockaddr-2) structure, is smaller than the sizeof(sockaddr).
Does this error belongs to socket
or bind
call?
The error comes from calling udp_send.
The problem is that when calling udp_listen with local=NULL, it will not bind to a specific address or AF. Most of the time it binds to IPv6 socket.
Some platforms have the IPV6ONLY option enabled (e.g. MacOS, Windows, FreeBSD) so it will not work to send a packet to IPv4 host here.
I am not sure its worth fixing this.
One option is to read the IPV6ONLY flag in case local=NULL.
DRAFT
How should we handle if local address to udp_listen is NULL? Example:
For example Windows fails with: