pear2/Net_RouterOS

Persistent connections

SonarSoftware opened this issue · 2 comments

I'm trying to test persistent connections, and having some issues in Ubuntu. Specifically, I get:

PEAR2\Net\Transmitter\SocketException: stream_socket_client(): unable to connect to tcp://192.168.1.1:8728/sonar%2Fsonar (Failed to parse address "192.168.1.1:8728/sonar%2Fsonar") in /mnt/hgfs/Sonar/sonar/vendor/pear2/net_transmitter/src/PEAR2/Net/Transmitter/TcpClient.php:222

This seems similar to the issue previously fixed in #27

It is the same issue, yes. As described in #27, the part after the port is what's causing the problem, but that part is necessary for persistent connections, and only for persistent connections. What was previously fixed was that the part after the port is now not included for non-persistent connections, where it is not needed.

So if you want to use persistent connections, I'm afraid you'd need to upgrade Ubuntu and PHP to more recent versions. More specifically, anything after Ubuntu 16.04 and/or at least PHP 7.1.5/7.0.19.

Ah, I am on 7.0.18 so I'll upgrade. Thanks!