Skip to content

Commit

Permalink
make udp connection non-blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyanwang committed Oct 8, 2018
1 parent 8d8106d commit 7ce8600
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 7ce8600

Please sign in to comment.