bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
770 stars 461 forks source link

stream_socket_client(): unable to connect to tcp://mqtt.test.com:1883 (Connection timed out) #130

Closed nidhinnp closed 3 years ago

nidhinnp commented 3 years ago

at vendor/salmanzafar/laravel-mqtt/src/MqttClass/MqttService.php:79 75▕ } 76▕ $socketContext = stream_context_create($sslOptions); 77▕ $this->socket = stream_socket_client("tls://" . $this->address . ":" . $this->port, $errno, $errstr, $this->timeout, STREAM_CLIENT_CONNECT, $socketContext); 78▕ } else { ➜ 79▕ $this->socket = stream_socket_client("tcp://" . $this->address . ":" . $this->port, $errno, $errstr, $this->timeout, STREAM_CLIENT_CONNECT); 80▕ } 81▕ if (!$this->socket ) { 82▕ if($this->debug) error_log("stream_socket_create() $errno, $errstr \n"); 83▕ return false;