$host
$host : string
主机名
$handler : \Yurun\Util\YurunHttp\Handler\Swoole
Swoole 协程客户端对象
$requestMap : array<mixed,\Yurun\Util\YurunHttp\Http\Request>
请求集合
__construct(string $host, integer $port, boolean $ssl, \Yurun\Util\YurunHttp\Handler\Swoole $handler = null)
string | $host | |
integer | $port | |
boolean | $ssl | |
\Yurun\Util\YurunHttp\Handler\Swoole | $handler |
getHttpHandler() : \Yurun\Util\YurunHttp\Handler\IHandler
获取 Http Handler
send(\Yurun\Util\YurunHttp\Http\Request $request, boolean $pipeline = false, boolean $dropRecvResponse = false) : integer|boolean
发送数据 成功返回streamId,失败返回false
\Yurun\Util\YurunHttp\Http\Request | $request | |
boolean | $pipeline | 默认send方法在发送请求之后,会结束当前的Http2 Stream,启用PIPELINE后,底层会保持stream流,可以多次调用write方法,向服务器发送数据帧,请参考write方法。 |
boolean | $dropRecvResponse | 丢弃接收到的响应数据 |
recv(integer|null $streamId = -1, double|null $timeout = null) : \Yurun\Util\YurunHttp\Http\Response|boolean
接收数据
integer|null | $streamId | 默认不传为 -1 时则监听服务端推送 |
double|null | $timeout | 超时时间,单位:秒。默认为 null 不限制 |