note 101909 added to function.socket-connect

From: Date: Mon, 17 Jan 2011 18:55:32 +0000
Subject: note 101909 added to function.socket-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-175838@lists.php.net to get a copy of this message
Note that as of PHP5.3 it is not possible to send IPv6 multicast to link-local addresses, because socket_connect() is just a trimmed-down version of connect() and does not support passing sin6_scope_id - the scope ID is required when sending packets to ff02::1 (all-nodes), for example. At first I thought I needed to bind the socket to the device using SO_BINDTODEVICE option (undefined constant in PHP - use numeric value 25), but it makes no difference, only requires root privileges to produce no usable results. Also, if you think you are sending multicast packets to link local addresses just because socket_sendto() returns a positive number of bytes, you might be wrong - just returning success does not mean that packets are sent over any link at all. In my test case I was sending to ff02::1, I could detect no errors, but Wireshark showed no packets. They end up in void. This is irrelevant to the handling of local reception sockets, so UDP listeners should still work as usual with IPv6/UDP. You might want to resort to C for implementing multicasters, though. ---- Server IP: 82.177.164.100 Probable Submitter: 89.76.148.31 ---- Manual Page -- http://www.php.net/manual/en/function.socket-connect.php Edit -- https://master.php.net/note/edit/101909 Del: integrated -- https://master.php.net/note/delete/101909/integrated Del: useless -- https://master.php.net/note/delete/101909/useless Del: bad code -- https://master.php.net/note/delete/101909/bad+code Del: spam -- https://master.php.net/note/delete/101909/spam Del: non-english -- https://master.php.net/note/delete/101909/non-english Del: in docs -- https://master.php.net/note/delete/101909/in+docs Del: other reasons-- https://master.php.net/note/delete/101909 Reject -- https://master.php.net/note/reject/101909 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175838) next »