3 $res = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
5 socket_bind($res, "127.0.0.1", 10051);
7 $t = socket_listen($res);
8 $res2 = socket_accept($res);
9 echo "I went past listen\n";
11 if($i == -1) echo "Failed to fork\n";
14 echo "Child processing\n";
16 socket_send($res2, "stuff\n", 6, 0);
18 echo "Child wait data\n";
19 $k = socket_recv($res2, $str, 16, MSG_WAITALL);
20 echo "Child got data\n";
21 socket_send($res2, $str, $k, 0);