From 7ce86002f29125b78176b400fc841addc891e82e Mon Sep 17 00:00:00 2001 From: Nadeem Shabir Date: Mon, 8 Oct 2018 09:55:39 +0100 Subject: [PATCH] make udp connection non-blocking --- src/classes/StatsD.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/classes/StatsD.class.php b/src/classes/StatsD.class.php index f54e2200..958760e0 100644 --- a/src/classes/StatsD.class.php +++ b/src/classes/StatsD.class.php @@ -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))