فهرست منبع

Update AsyncUdpConnection.php

walkor 7 سال پیش
والد
کامیت
41b6c92718
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      Connection/AsyncUdpConnection.php

+ 5 - 1
Connection/AsyncUdpConnection.php

@@ -165,7 +165,11 @@ class AsyncUdpConnection extends UdpConnection
         if ($this->connected === true) {
             return;
         }
-        $this->_socket = stream_socket_client("udp://{$this->_remoteAddress}");
+        $this->_socket = stream_socket_client("udp://{$this->_remoteAddress}", $errno, $errmsg);
+        if (!$this->_socket) {
+            echo new \Exception($errmsg);
+            return;
+        }
         if ($this->onMessage) {
             Worker::$globalEvent->add($this->_socket, EventInterface::EV_READ, array($this, 'baseRead'));
         }