Hi there,
I have not managed to make stream_socket_sendto work with any address, with Unix Datagram sockets (ugd:///some/file/path)
Does anybody know the correct syntax for doing this, or has managed to get this to work.
What I want to do is to broadcast a message to several sockets in the same directory. This should be straightforward but I've no idea how to make stream_socket_sendto work with udg.
I've tried
stream_socket_sendto($sock, $msg, 0 /* flags */, "udg://$sockpath");
and
stream_socket_sendto($sock, $msg, 0 /* flags */, "unix://$sockpath");
as well as
stream_socket_sendto($sock, $msg, 0 /* flags */, "unix://$sockpath:0");
all of which fail with the error:
Warning:stream_socket_sendto() [function.stream-socket-sendto]: php_network_getaddresses: getaddrinfo failed: Name or service not known'
And also produces the warning
Warning: stream_socket_sendto() [function.stream-socket-sendto]: Failed to parse `udg:///home/mark/progs/site/sockets/2735.udg' into a valid network address in /home/mark/progs/site/udgclient.php on line 37
Mark