Skip to content

Commit 8c57030

Browse files
Merge pull request #22 from luutruong/master
Fixed missing check socket
2 parents 233bb97 + 9387f65 commit 8c57030

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Socket.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ public function read(IUnpacker $unpacker)
132132
*/
133133
public function readBuffer(int $length = 2048): string
134134
{
135+
if (!is_resource($this->socket)) {
136+
Bolt::error('Not initialized socket');
137+
return;
138+
}
139+
135140
$output = '';
136141
do {
137142
$readed = socket_read($this->socket, $length - mb_strlen($output, '8bit'), PHP_BINARY_READ);

0 commit comments

Comments
 (0)