You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
15
vendor/swoole/examples/php/socket_client.php
vendored
Executable file
15
vendor/swoole/examples/php/socket_client.php
vendored
Executable file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
pcntl_signal(SIGIO, function () {
|
||||
echo "SIGIO";
|
||||
});
|
||||
|
||||
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
socket_connect($socket, '127.0.0.1', 8889);
|
||||
|
||||
$timeout = array('sec'=>1, 'usec' => 500000);
|
||||
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
|
||||
|
||||
$n = socket_recv($socket, $buf, 2048, MSG_WAITALL);
|
||||
|
||||
var_dump($n, $buf);
|
Reference in New Issue
Block a user