Unsolved Does Qt have APIs that support SOCK_DGRAM socket in Unix domain?
-
It seems like QLocalSocket only supports SOCK_STREAM socket.
Do I have to use POSIX API? -
Hi and welcome to the forums
what about http://doc.qt.io/qt-5/qudpsocket.html `? -
I know QudpSocket, but that's from TCP/IP domain. What I want is from Unix domain. They are different.
-
@jasonlwm
Hi
if SOCK_DGRAM is a special unix type of UDP, im not sure Qt has anything for it. -
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.