Lines Matching refs:socket
2 Test if socket_recvfrom() receives data sent by socket_sendto() through a Unix domain socket
12 $socket = socket_create(AF_UNIX, SOCK_DGRAM, SOL_UDP); // cause warning
13 $socket = socket_create(AF_UNIX, SOCK_DGRAM, 0);
14 if (!$socket) {
15 die('Unable to create AF_UNIX socket');
17 if (!socket_set_nonblock($socket)) {
18 die('Unable to set nonblocking mode for socket');
20 var_dump(socket_recvfrom($socket, $buf, 12, 0, $from, $port)); //false (EAGAIN, no warning)
22 if (!socket_bind($socket, $address)) {
28 $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address);
31 die('An error occurred while sending to the socket');
38 var_dump(socket_recvfrom($socket, $buf, 0, 0, $from)); // expect false
39 $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from);
42 die('An error occurred while receiving from the socket');
49 socket_close($socket);
53 Warning: socket_create(): Unable to create socket [%d]: Protocol not supported in %s on line %d