mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Fixed WebSocketClient::push TypeError, expects integer, but boolean given. (#940)
This commit is contained in:
parent
3fa03c5fbe
commit
2f7a8b0050
@ -21,6 +21,7 @@
|
||||
- [#909](https://github.com/hyperf/hyperf/pull/909) Fixed a issue that causes staled parallel execution.
|
||||
- [#925](https://github.com/hyperf/hyperf/pull/925) Fixed the dead cycle caused by socket closed.
|
||||
- [#932](https://github.com/hyperf/hyperf/pull/932) Fixed `Translator::setLocale` does not works in coroutine evnironment.
|
||||
- [#940](https://github.com/hyperf/hyperf/pull/940) Fixed WebSocketClient::push TypeError, expects integer, but boolean given.
|
||||
|
||||
## Optimized
|
||||
|
||||
|
@ -67,9 +67,15 @@ class Client
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function push(string $data, int $opcode = WEBSOCKET_OPCODE_TEXT, bool $finish = true): bool
|
||||
/**
|
||||
* @param bool|int $finish TODO: When swoole version >= 4.4.12, `finish` is SWOOLE_WEBSOCKET_FLAG_FIN or SWOOLE_WEBSOCKET_FLAG_COMPRESS
|
||||
*/
|
||||
public function push(string $data, int $opcode = WEBSOCKET_OPCODE_TEXT, $finish = null): bool
|
||||
{
|
||||
return $this->client->push($data, $opcode, $finish);
|
||||
if (isset($finish)) {
|
||||
return $this->client->push($data, $opcode, $finish);
|
||||
}
|
||||
return $this->client->push($data, $opcode);
|
||||
}
|
||||
|
||||
public function close(): bool
|
||||
|
Loading…
Reference in New Issue
Block a user