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