Receive UDP Broadcast

[email protected] ("[email protected]")
Newsgroups php.general
Message-ID <[email protected]>
Hi!

how can i receive an UDP broadcast to 255.255.255.255 on an dedicated 
interface?

this is my first try, but no luck, how can i enable the broadcast 
feature for my socket?

             $address = 'udp://10.88.0.255:20000';
#            $address = 'udp://10.88.0.20:20000'; // not working
#            $address = 'udp://255.255.255.255:20000'; //also not 
working, so i missing the interface binding to?!

             $context = stream_context_create([
                 'socket' => [
                     'so_broadcast' => 1,
                 ],
             ]);
             $socket = @\stream_socket_server($address, $errno, $errstr, 
\STREAM_SERVER_BIND, $context);

my code is working fine for any unicast packet, but broadcast isnt 
reache this socket. the excepted broadcast-packets can i see with 
tcpdump on my server-intrerface.

any hints for my problem?

regards, volker.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.