-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
3.x, 5.5.1
-
None
Regarding QLocalSocket::connectToServer()
https://doc.qt.io/qt-4.8/qlocalsocket.html#connectToServer
When calling QLocalSocket::connectToServer() with the first argument "name" being a relative path, Qt assumes that it should relate this path to "/tmp/" instead of the current working directory.
This behaviour is not documented. Furthermore, it is not intuitive. While it is true that some UNIX sockets reside in /tmp/, they can also be in /var/run/, /run/, or virtually anywhere.
We stumbled upon this while trying to get below the unix path size of 104 characters in linux. Switching from absolute paths to relative paths is technically impossible with this implementation.
http://code.qt.io/cgit/qt/qtbase.git/tree/src/network/socket/qlocalsocket_unix.cpp#n263
I understand that this API is ancient and this behaviour should not be changed. But at least please put a warning in the API docs.