/php-src/ext/sockets/tests/ |
H A D | socket_shutdown.phpt | 2 bool socket_shutdown ( resource $socket [, int $how = 2 ] ) ; 22 var_dump(socket_shutdown($socket,0)); 23 socket_close($socket); 27 var_dump(socket_shutdown($socket,1)); 28 socket_close($socket); 32 var_dump(socket_shutdown($socket,2)); 33 socket_close($socket); 36 var_dump(socket_shutdown($socket,0)); 39 var_dump(socket_shutdown($socket,-1)); 40 socket_close($socket); [all …]
|
H A D | socket_shutdown-win32.phpt | 2 bool socket_shutdown ( resource $socket [, int $how = 2 ] ) ; 28 var_dump(socket_shutdown($socket,0)); 29 socket_close($socket); 33 var_dump(socket_shutdown($socket,1)); 34 socket_close($socket); 38 var_dump(socket_shutdown($socket,2)); 39 socket_close($socket); 42 var_dump(socket_shutdown($socket,0)); 45 var_dump(socket_shutdown($socket,-1)); 46 socket_close($socket); [all …]
|
H A D | socket_reuseport_cbpf.phpt | 14 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 16 if (!$socket) { 17 die('Unable to create AF_INET socket [socket]'); 19 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_REUSEADDR, true)); 20 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_REUSEPORT, true)); 21 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, SKF_AD_CPU)); 22 var_dump(socket_bind($socket, '0.0.0.0')); 23 socket_listen($socket); 24 socket_close($socket);
|
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)) { 29 $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address); 32 die('An error occurred while sending to the socket'); 40 $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from); 43 die('An error occurred while receiving from the socket'); [all …]
|
H A D | socket_sentto_recvfrom_ipv4_udp.phpt | 7 $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); 8 if (!$socket) { 9 die('Unable to create AF_INET socket'); 12 if (!socket_bind($socket, '127.0.0.1', 0)) { 14 'An error occurred while binding socket: %s', 15 socket_strerror(socket_last_error($socket)))); 18 socket_getsockname($socket, $address, $port); 25 'An error occurred while sending to the socket: %s', 26 socket_strerror(socket_last_error($socket)))); 39 $socket, $buffering, $wants, 0, $address, $port); [all …]
|
H A D | socket_set_option_rcvtimeo.phpt | 10 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 11 if (!$socket) { 12 die('Unable to create AF_INET socket [socket]'); 14 socket_set_block($socket); 18 $retval_1 = socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, []); 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 | 10 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 11 if (!$socket) { 12 die('Unable to create AF_INET socket [socket]'); 14 socket_set_block($socket); 18 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, []); 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_ipv6_udp.phpt | 15 $socket = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); 16 if (!$socket) { 17 die('Unable to create AF_INET6 socket'); 20 if (!socket_bind($socket, '::1', 0)) { 22 'An error occurred while binding socket: %s', 23 socket_strerror(socket_last_error($socket)))); 26 socket_getsockname($socket, $address, $port); 33 'An error occurred while sending to the socket: %s', 34 socket_strerror(socket_last_error($socket)))); 47 $socket, $buffering, $wants, 0, $address, $port); [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_acf.phpt | 17 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 19 if (!$socket) { 20 die('Unable to create AF_INET socket [socket]'); 23 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER, 1)); 27 socket_listen($socket); 28 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER, "httpready")); 29 var_dump(socket_get_option( $socket, SOL_SOCKET, SO_ACCEPTFILTER)); 30 socket_close($socket);
|
H A D | socket_setopt_basic.phpt | 10 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 11 if (!$socket) { 12 die('Unable to create AF_INET socket [socket]'); 14 socket_set_block($socket); 18 $retval_1 = socket_setopt( $socket, SOL_SOCKET, SO_SNDTIMEO, $options); 19 $retval_2 = socket_getopt( $socket, SOL_SOCKET, SO_SNDTIMEO); 23 socket_close($socket);
|
H A D | socket_set_option_tsf.phpt | 14 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 16 if (!$socket) { 17 die('Unable to create AF_INET socket [socket]'); 19 socket_set_option( $socket, SOL_TCP, TCP_FUNCTION_BLK, "nochancetoexist"); 21 var_dump(socket_set_option( $socket, SOL_TCP, TCP_FUNCTION_BLK, "freebsd")); 22 var_dump(socket_get_option( $socket, SOL_TCP, TCP_FUNCTION_BLK)); 23 socket_close($socket); 26 Warning: socket_set_option(): Unable to set socket option [2]: No such file or directory in %s on l…
|
H A D | ipv4loop.phpt | 7 /* Setup socket server */ 10 die('Unable to create AF_INET socket [server]'); 18 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 | socket_clear_error.phpt | 2 void socket_clear_error ([ resource $socket ] ) ; 16 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 17 socket_set_option($socket, -1, -1, -1); 18 var_dump(socket_last_error($socket)); 19 socket_clear_error($socket); 20 var_dump(socket_last_error($socket)); 23 Warning: socket_set_option(): Unable to set socket option [%s]: %s in %s on line %d
|
H A D | socket_send.phpt | 2 int socket_send ( resource $socket , string $buf , int $len , int $flags ); 19 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 20 $socketConn = socket_connect($socket, $host, $port); 22 if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_OOB)===$stringSocketLength){ 26 if(!defined('MSG_EOR') || socket_send($socket, $stringSocket, $stringSocketLength, MSG_EOR)===$stri… 30 if(!defined('MSG_EOF') || socket_send($socket, $stringSocket, $stringSocketLength, MSG_EOF)===$stri… 34 if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_DONTROUTE)===$stringSocketLength){ 39 socket_close($socket); 44 unset($socket);
|
H A D | socket_sentto_recvfrom_ipv6_udp-win32.phpt | 15 $socket = socket_create(AF_INET6, SOCK_DGRAM, SOL_UDP); 16 if (!$socket) { 17 die('Unable to create AF_INET6 socket'); 19 if (!socket_set_nonblock($socket)) { 20 die('Unable to set nonblocking mode for socket'); 22 socket_recvfrom($socket, $buf, 12, 0, $from, $port); // cause warning 24 if (!socket_bind($socket, $address, 1223)) { 30 $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address, 1223); 32 die('An error occurred while sending to the socket'); 41 die('An error occurred while receiving from the socket'); [all …]
|
H A D | socket_defer_acp.phpt | 15 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 17 if (!$socket) { 18 die('Unable to create AF_INET socket [socket]'); 21 var_dump(socket_set_option( $socket, SOL_TCP, TCP_DEFER_ACCEPT, $initial_val)); 22 socket_listen($socket); 23 $rounded_up_val = socket_get_option( $socket, SOL_TCP, TCP_DEFER_ACCEPT); 24 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 22 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 23 if (!$socket) { 24 die('Unable to create AF_INET socket [socket]'); 27 socket_set_option( $socket, SOL_SOCKET, 1, 1); 28 socket_close($socket); 31 Warning: socket_set_option(): Unable to set socket option [%d]: Permission denied in %s on line %d
|
H A D | ipv6loop.phpt | 12 /* Setup socket server */ 15 die('Unable to create AF_INET6 socket [server]'); 28 die('Unable to listen on socket'); 34 die('Unable to create AF_INET6 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); 52 socket_close($socket);
|
H A D | socket_bpf_extensions.phpt | 13 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 14 if (!$socket) { 15 die('Unable to create AF_INET socket [socket]'); 17 $flags = socket_getopt( $socket, SOL_SOCKET, SO_BPF_EXTENSIONS); 20 socket_close($socket);
|
H A D | socket_set_option_seolinger.phpt | 11 $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 13 if (!$socket) { 14 die('Unable to create AF_INET socket [socket]'); 18 $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_LINGER, []); 25 $retval_2 = socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options); 26 $retval_3 = socket_get_option( $socket, SOL_SOCKET, SO_LINGER); 31 var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_2)); 41 socket_close($socket);
|
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); 36 Warning: socket_set_option(): Unable to set socket option [19]: No such device in %s on line %d
|
/php-src/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);
|
/php-src/ext/pgsql/tests/ |
H A D | pg_socket_poll.phpt | 2 PostgreSQL poll on connection's socket 16 $socket = pg_socket($db); 24 if (($topoll = pg_socket_poll($socket, 1, 1, 1)) === -1) die("pg_socket_poll failed"); 25 stream_set_blocking($socket, false); 30 nb_is_writable($socket); 33 nb_is_writable($socket); 48 pg_socket_poll(): Argument #1 ($socket) invalid resource socket
|