Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Does Qt have APIs that support SOCK_DGRAM socket in Unix domain?
Forum Update on Monday, May 27th 2025

Does Qt have APIs that support SOCK_DGRAM socket in Unix domain?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jasonlwm
    wrote on last edited by
    #1

    It seems like QLocalSocket only supports SOCK_STREAM socket.
    Do I have to use POSIX API?

    mrjjM 1 Reply Last reply
    1
    • J jasonlwm

      It seems like QLocalSocket only supports SOCK_STREAM socket.
      Do I have to use POSIX API?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @jasonlwm

      Hi and welcome to the forums
      what about http://doc.qt.io/qt-5/qudpsocket.html `?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jasonlwm
        wrote on last edited by
        #3

        I know QudpSocket, but that's from TCP/IP domain. What I want is from Unix domain. They are different.

        mrjjM 1 Reply Last reply
        1
        • J jasonlwm

          I know QudpSocket, but that's from TCP/IP domain. What I want is from Unix domain. They are different.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @jasonlwm
          Hi
          if SOCK_DGRAM is a special unix type of UDP, im not sure Qt has anything for it.

          1 Reply Last reply
          1
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            J 1 Reply Last reply
            2
            • Christian EhrlicherC Christian Ehrlicher

              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

              J Offline
              J Offline
              jasonlwm
              wrote on last edited by
              #6

              @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.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                There is no file which contains AF_UNIX or AC_LOCAL in the qtbase source tree so I would guess no.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                J 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  There is no file which contains AF_UNIX or AC_LOCAL in the qtbase source tree so I would guess no.

                  J Offline
                  J Offline
                  jasonlwm
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher
                  Hi, QLocalSocket use AF_UNIX(or PF_UNIX):
                  https://code.woboq.org/qt5/qtbase/src/network/socket/qlocalsocket_unix.cpp.html#247

                  But the type is SOCK_STREAM, not SOCK_DGRAM.
                  So, I guess I'll have to use Posix APIs.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved