You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
28
vendor/swoole/tests/swoole_event/swoole_event_write.phpt
vendored
Executable file
28
vendor/swoole/tests/swoole_event/swoole_event_write.phpt
vendored
Executable file
@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
global_function: swoole_event_write
|
||||
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/../include/bootstrap.php';
|
||||
|
||||
$fp = stream_socket_client("tcp://www.qq.com:80", $errno, $errstr, 30);
|
||||
|
||||
swoole_event_add($fp, function($fp) {
|
||||
$resp = fread($fp, 8192);
|
||||
|
||||
//socket处理完成后,从epoll事件中移除socket
|
||||
swoole_event_del($fp);
|
||||
fclose($fp);
|
||||
|
||||
echo "SUCCESS\n";
|
||||
});
|
||||
|
||||
swoole_event_write($fp, "GET / HTTP/1.1\r\nHost: www.qq.com\r\n\r\n");
|
||||
|
||||
echo "Finish\n";
|
||||
?>
|
||||
|
||||
--EXPECT--
|
||||
Finish
|
||||
|
||||
SUCCESS
|
Reference in New Issue
Block a user