We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 694f4f6 commit e2fbdaeCopy full SHA for e2fbdae
src/Apis/Api.php
@@ -119,7 +119,13 @@ public function webSocketRes($message)
119
if (is_array($message[0] ?? 'e')) {
120
$messages = $message;
121
foreach ($messages as $v) {
122
- $this->wsClient->sendData(gzencode(json_encode(array_shift($messages))), Protocol::TYPE_BINARY);
+ try {
123
+ $this->wsClient->sendData(gzencode(json_encode(array_shift($message))), Protocol::TYPE_BINARY);
124
+ } catch (\Throwable $e) {
125
+ dump($e->getMessage());
126
+ $this->wsClient->disconnect();
127
+ $this->wsClient->connect();
128
+ }
129
}
130
} else {
131
$this->wsClient->sendData(gzencode(json_encode($message)), Protocol::TYPE_BINARY);
0 commit comments