qlg.tsgz.moe/vendor/swoole/tests/swoole_event/swoole_event_del.phpt
2019-09-06 23:53:10 +08:00

28 lines
596 B
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
global_function: swoole_event_del
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--INI--
assert.active=1
assert.warning=1
assert.bail=0
assert.quiet_eval=0
--FILE--
<?php
require_once __DIR__ . '/../include/bootstrap.php';
$fp = stream_socket_client("tcp://www.qq.com:80", $errno, $errstr, 30);
fwrite($fp, "GET / HTTP/1.1\r\nHost: www.qq.com\r\n\r\n");
swoole_event_add($fp, function($fp) {
$resp = fread($fp, 8192);
//socket处理完成后从epoll事件中移除socket
swoole_event_del($fp);
fclose($fp);
});
Swoole\Event::wait();
?>
--EXPECT--