/PHP-5.5/ext/standard/tests/network/ |
H A D | shutdown.phpt | 12 /* Setup socket server */ 42 $socket = stream_socket_accept($server); 43 if (!$socket) { 46 @fwrite($socket, fgets($socket)); 47 @fwrite($socket, fgets($socket)); 48 fclose($socket); 55 $socket = stream_socket_accept($server); 56 if (!$socket) { 59 @fwrite($socket, fgets($socket)); 60 @fwrite($socket, fgets($socket)); [all …]
|
H A D | unixloop.phpt | 12 die('Temporary socket already exists.'); 14 /* Setup socket server */ 17 die('Unable to create AF_UNIX socket [server]'); 23 die('Unable to create AF_UNIX socket [client]'); 27 $socket = stream_socket_accept($server); 28 if (!$socket) { 34 $data = fread($socket, 10); 38 fclose($socket);
|
H A D | tcp4loop.phpt | 8 /* Setup socket server */ 15 die('Unable to create AF_INET socket [server]'); 21 die('Unable to create AF_INET socket [client]'); 25 $socket = stream_socket_accept($server); 26 if (!$socket) { 32 $data = fread($socket, 10); 36 fclose($socket);
|
H A D | tcp6loop.phpt | 16 /* Setup socket server */ 24 die('Unable to create AF_INET6 socket [server]'); 30 die('Unable to create AF_INET6 socket [client]'); 34 $socket = stream_socket_accept($server); 35 if (!$socket) { 41 $data = fread($socket, 10); 45 fclose($socket);
|
/PHP-5.5/ext/sockets/tests/ |
H A D | socket_sentto_recvfrom_unix.phpt | 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'); 23 if (!socket_bind($socket, $address)) { 30 $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address); 33 die('An error occurred while sending to the socket'); 41 $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from); 44 die('An error occurred while receiving from the socket'); [all …]
|
H A D | unixloop.phpt | 2 Unix domain socket Loopback test 17 die('Temporary socket already exists.'); 19 /* Setup socket server */ 22 die('Unable to create AF_UNIX socket [server]'); 28 die('Unable to listen on socket'); 34 die('Unable to create AF_UNIX socket [client]'); 37 die('Unable to connect to server socket'); 41 $socket = socket_accept($server); 42 if (!$socket) { 48 $data = socket_read($socket, 10, PHP_BINARY_READ); [all …]
|
H A D | socket_set_option_rcvtimeo.phpt | 14 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 15 if (!$socket) { 16 die('Unable to create AF_INET socket [socket]'); 18 socket_set_block($socket); 21 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_RCVTIMEO, array()); 25 $retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_RCVTIMEO, $options); 26 $retval_3 = socket_get_option( $socket, SOL_SOCKET, SO_RCVTIMEO); 30 socket_close($socket);
|
H A D | socket_set_option_sndtimeo.phpt | 14 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 15 if (!$socket) { 16 die('Unable to create AF_INET socket [socket]'); 18 socket_set_block($socket); 21 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, array()); 25 $retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, $options); 26 $retval_3 = socket_get_option( $socket, SOL_SOCKET, SO_SNDTIMEO); 30 socket_close($socket);
|
H A D | socket_sentto_recvfrom_ipv4_udp.phpt | 10 $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); 11 if (!$socket) { 12 die('Unable to create AF_INET socket'); 14 if (!socket_set_nonblock($socket)) { 15 die('Unable to set nonblocking mode for socket'); 19 socket_sendto($socket, '', 1, 0, $address); // cause warning 20 if (!socket_bind($socket, $address, 1223)) { 30 die('An error occurred while sending to the socket'); 37 socket_recvfrom($socket, $buf, 12, 0); // cause warning 41 die('An error occurred while receiving from the socket'); [all …]
|
H A D | socket_sentto_recvfrom_ipv6_udp.phpt | 14 $socket = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); 15 if (!$socket) { 16 die('Unable to create AF_INET6 socket'); 18 if (!socket_set_nonblock($socket)) { 19 die('Unable to set nonblocking mode for socket'); 23 socket_sendto($socket, '', 1, 0, $address); // cause warning 24 if (!socket_bind($socket, $address, 1223)) { 32 die('An error occurred while sending to the socket'); 39 socket_recvfrom($socket, $buf, 12, 0); // cause warning 43 die('An error occurred while receiving from the socket'); [all …]
|
H A D | socket_sentto_recvfrom_ipv6_udp-win32.phpt | 14 $socket = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); 15 if (!$socket) { 16 die('Unable to create AF_INET6 socket'); 18 if (!socket_set_nonblock($socket)) { 19 die('Unable to set nonblocking mode for socket'); 23 socket_sendto($socket, '', 1, 0, $address); // cause warning 24 if (!socket_bind($socket, $address, 1223)) { 32 die('An error occurred while sending to the socket'); 39 socket_recvfrom($socket, $buf, 12, 0); // cause warning 43 die('An error occurred while receiving from the socket'); [all …]
|
H A D | ipv4loop.phpt | 11 /* Setup socket server */ 14 die('Unable to create AF_INET socket [server]'); 20 die('Unable to listen on socket'); 26 die('Unable to create AF_INET socket [client]'); 29 die('Unable to connect to server socket'); 33 $socket = socket_accept($server); 34 if (!$socket) { 40 $data = socket_read($socket, 10, PHP_BINARY_READ); 44 socket_close($socket);
|
H A D | ipv6loop.phpt | 12 /* Setup socket server */ 15 die('Unable to create AF_INET6 socket [server]'); 21 die('Unable to listen on socket'); 27 die('Unable to create AF_INET6 socket [client]'); 30 die('Unable to connect to server socket'); 34 $socket = socket_accept($server); 35 if (!$socket) { 41 $data = socket_read($socket, 10, PHP_BINARY_READ); 45 socket_close($socket);
|
H A D | socket_set_option_error_socket_option.phpt | 2 Test if socket_set_option() returns 'unable to set socket option' failure for invalid options 21 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 22 if (!$socket) { 23 die('Unable to create AF_INET socket [socket]'); 26 socket_set_option( $socket, SOL_SOCKET, 1, 1); 27 socket_close($socket); 33 Warning: socket_set_option(): unable to set socket option [%d]: Permission denied in %s on line %d
|
H A D | socket_set_option_bindtodevice.phpt | 20 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 22 if (!$socket) { 23 die('Unable to create AF_INET socket [socket]'); 26 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_BINDTODEVICE, "lo"); 28 $retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_BINDTODEVICE, "ethIDONOTEXIST"); 31 socket_close($socket); 37 Warning: socket_set_option(): unable to set socket option [19]: No such device in %s on line %d
|
H A D | socket_set_option_seolinger.phpt | 15 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 17 if (!$socket) { 18 die('Unable to create AF_INET socket [socket]'); 21 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_LINGER, array()); 25 $retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options); 26 $retval_3 = socket_get_option( $socket, SOL_SOCKET, SO_LINGER); 30 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_2)); 37 socket_close($socket);
|
H A D | socket_getpeername_ipv4loop.phpt | 20 /* Setup socket server */ 23 die('Unable to create AF_INET socket [server]'); 30 die('Unable to listen on socket'); 36 die('Unable to create AF_INET socket [client]'); 39 die('Unable to connect to server socket'); 43 $socket = socket_accept($server); 44 if (!$socket) { 54 socket_close($socket);
|
H A D | socket_getpeername_ipv6loop.phpt | 21 /* Setup socket server */ 24 die('Unable to create AF_INET6 socket [server]'); 31 die('Unable to listen on socket'); 37 die('Unable to create AF_INET6 socket [client]'); 40 die('Unable to connect to server socket'); 44 $socket = socket_accept($server); 45 if (!$socket) { 55 socket_close($socket);
|
/PHP-5.5/ext/standard/tests/file/ |
H A D | fgets_socket_variation1.phpt | 2 fgets() with a socket stream 10 /* Setup socket server */ 21 die("Unable to create socket"); 25 $socket = stream_socket_accept($server); 28 fwrite($socket, "line1\nline2\nline3\n"); 37 echo "\n\nClose the server side socket and read the remaining data from the client\n"; 38 fclose($socket); 61 Close the server side socket and read the remaining data from the client
|
H A D | fgets_socket_variation2.phpt | 2 fgets() over a socket with more than a buffer's worth of data 21 /* Setup socket server */ 32 die("Unable to create socket"); 36 $socket = stream_socket_accept($server); 42 var_dump(fwrite($socket, $data)); 43 fclose($socket); 53 echo "\nClose the server side socket and read the remaining data from the client\n"; 68 Close the server side socket and read the remaining data from the client
|
/PHP-5.5/main/streams/ |
H A D | xp_socket.c | 60 if (sock->socket == -1) { in php_sockop_write() 119 if (sock->socket == -1) { in php_sock_stream_wait_for_data() 149 if (sock->socket == -1) { in php_sockop_read() 185 if (sock->socket == -1) in php_sockop_close() 186 sock->socket = SOCK_ERR; in php_sockop_close() 188 if (sock->socket != SOCK_ERR) { in php_sockop_close() 203 closesocket(sock->socket); in php_sockop_close() 204 sock->socket = SOCK_ERR; in php_sockop_close() 218 return fsync(sock->socket); in php_sockop_flush() 293 if (sock->socket == -1) { in php_sockop_set_option() [all …]
|
/PHP-5.5/ext/mysqli/tests/ |
H A D | mysqli_pconn_twice.phpt | 19 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 20 … Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 21 $host, $user, $db, $port, $socket); 23 if (true !== ($tmp = my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))) 37 if (!$link = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) 39 $host, $user, $db, $port, $socket); 42 if (true !== ($tmp = $link->real_connect($host, $user, $passwd, $db, $port, $socket))) 56 if (NULL !== ($tmp = $link->connect($host, $user, $passwd, $db, $port, $socket))) 59 if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 61 $host, $user, $db, $port, $socket); [all …]
|
H A D | mysqli_pconn_conn_multiple.phpt | 19 if (!$link = my_mysqli_connect($phost, $user, $passwd, $db, $port, $socket)) 21 $phost, $user, $db, $port, $socket); 44 if (!$link = new my_mysqli($phost, $user, $passwd, $db, $port, $socket)) 46 $phost, $user, $db, $port, $socket); 72 if (!$link = mysqli_connect($phost, $user, $passwd, $db, $port, $socket)) 74 $phost, $user, $db, $port, $socket); 83 $host, $user, $db, $port, $socket); 106 if (!$link = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) 108 $host, $user, $db, $port, $socket); 134 if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) [all …]
|
H A D | mysqli_connect_twice.phpt | 13 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 14 … Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 15 $host, $user, $db, $port, $socket); 20 if (true !== ($tmp = my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))) 38 if (!$link = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) 40 $host, $user, $db, $port, $socket); 45 if (true !== ($tmp = $link->real_connect($host, $user, $passwd, $db, $port, $socket))) 63 if (NULL !== ($tmp = $link->connect($host, $user, $passwd, $db, $port, $socket))) 66 if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 68 $host, $user, $db, $port, $socket); [all …]
|
/PHP-5.5/ext/standard/tests/streams/ |
H A D | stream_get_meta_data_socket_variation4.phpt | 2 Testing stream_get_meta_data() "eof" field on a udp socket 6 /* Setup socket server */ 12 die("Unable to create socket"); 16 $socket = stream_socket_accept($server); 19 fwrite($socket, "abcdefg\n1234567\nxyzxyz\n"); 26 echo "\n\nClose the server side socket and read the remaining data from the client:\n"; 27 fclose($socket); 76 Close the server side socket and read the remaining data from the client:
|