Skip to content

Commit 86d669c

Browse files
authored
remove feof() check on connection. this check fails under Windows wh… (#1177)
* remove feof() check on connection. this check fails under Windows when connecting to some (but not all) servers * reinstate feof() check for non-Windows systems
1 parent cb51453 commit 86d669c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PhpAmqpLib/Wire/IO/StreamIO.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ public function write($data)
245245
$write_start = microtime(true);
246246

247247
while ($written < $len) {
248-
if (!is_resource($this->sock) || feof($this->sock)) {
248+
// on Windows, feof() fails when connecting to some (but not all) servers
249+
if (!is_resource($this->sock) || (PHP_OS_FAMILY != 'Windows' && feof($this->sock))) {
249250
$this->close();
250251
$constants = SocketConstants::getInstance();
251252
throw new AMQPConnectionClosedException('Broken pipe or closed connection', $constants->SOCKET_EPIPE);

0 commit comments

Comments
 (0)