Skip to content

Commit

Permalink
Merge pull request weiboad#3 from steven-hilder/suppressConnectionWar…
Browse files Browse the repository at this point in the history
…nings

Suppress redundant warnings on connection failure
  • Loading branch information
nmred committed Oct 11, 2014
2 parents aa98947 + 7ee3a68 commit b3ba814
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Kafka/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,22 @@ public function connect()
throw new \Kafka\Exception('Cannot open without port.');
}

$this->stream = fsockopen(
$this->stream = @fsockopen(
$this->host,
$this->port,
$errno,
$errstr,
$this->sendTimeoutSec + ($this->sendTimeoutUsec / 1000000)
);

stream_set_blocking($this->stream, 0);

if ($this->stream == false) {
$error = 'Could not connect to '
. $this->host . ':' . $this->port
. ' ('.$errstr.' ['.$errno.'])';
throw new \Kafka\Exception($error);
}

stream_set_blocking($this->stream, 0);
}

// }}}
Expand Down

0 comments on commit b3ba814

Please sign in to comment.