/hphp/test/slow/streams/socket-select-index.php
PHP | 17 lines | 13 code | 4 blank | 0 comment | 0 complexity | 29c04d73279a30197b3a59840a7160a0 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- <<__EntryPoint>>
- function main_socket_select_index() {
- $msg = "Hello";
- $len = strlen($msg);
- $sockets = varray[];
- socket_create_pair(AF_UNIX, SOCK_STREAM, 0, inout $sockets);
- socket_write($sockets[0], $msg, $len);
- $fdset = darray[ 1 => $sockets[1] ];
- $write = $excep = varray[];
- socket_select(inout $fdset, inout $write, inout $excep, 0, 100);
- print_r($fdset);
- }