Does Qt have APIs that support SOCK_DGRAM socket in Unix domain?
-
Hi and welcome to the forums
what about http://doc.qt.io/qt-5/qudpsocket.html `? -
A QUdpSocket is using SOCK_DGRAM (what else should it use...) - see https://code.woboq.org/qt5/qtbase/src/network/socket/qnativesocketengine_unix.cpp.html#269
-
@Christian-Ehrlicher
Hi, QUdpSocket is using SOCK_DGRAM under AF_INET or AF_INET6 protocol, which belongs to TCP/IP domain.
There is another protocol called AF_LOCAL or AF_UNIX, which belongs to Unix domain:
https://code.woboq.org/qt5/include/bits/socket.h.html#93
And my question is under Unix domain. -
There is no file which contains AF_UNIX or AC_LOCAL in the qtbase source tree so I would guess no.
-
@Christian-Ehrlicher
Hi, QLocalSocket use AF_UNIX(or PF_UNIX):
https://code.woboq.org/qt5/qtbase/src/network/socket/qlocalsocket_unix.cpp.html#247But the type is SOCK_STREAM, not SOCK_DGRAM.
So, I guess I'll have to use Posix APIs.