Skip to content

Commit

Permalink
Merge pull request #130 from talis/non-blocking-statsd
Browse files Browse the repository at this point in the history
fsockopen UDP connections should be non-blocking
  • Loading branch information
kiyanwang authored Oct 9, 2018
2 parents 8d8106d + 7ce8600 commit d7a586d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/classes/StatsD.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ protected function send($data, $sampleRate=1) {
{
$fp = fsockopen("udp://{$this->host}", $this->port);
if (! $fp) { return; }
// make this a non blocking stream
stream_set_blocking($fp, false);
foreach ($sampledData as $stat => $value)
{
if (is_array($value))
Expand Down

0 comments on commit d7a586d

Please sign in to comment.