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 Updated to NodeBB v4.3 + New Features

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 1 Watching
  • 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 23 Sept 2018, 07:12 last edited by
    #1

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

    M 1 Reply Last reply 23 Sept 2018, 07:15
    1
    • J jasonlwm
      23 Sept 2018, 07:12

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

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 23 Sept 2018, 07:15 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 23 Sept 2018, 07:24 last edited by
        #3

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

        M 1 Reply Last reply 23 Sept 2018, 07:29
        1
        • J jasonlwm
          23 Sept 2018, 07:24

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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 23 Sept 2018, 07:29 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
          • C Online
            C Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 23 Sept 2018, 08:28 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 23 Sept 2018, 14:17
            2
            • C Christian Ehrlicher
              23 Sept 2018, 08:28

              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 23 Sept 2018, 14:17 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
              • C Online
                C Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 23 Sept 2018, 14:34 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 23 Sept 2018, 15:14
                1
                • C Christian Ehrlicher
                  23 Sept 2018, 14:34

                  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 23 Sept 2018, 15:14 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

                  8/8

                  23 Sept 2018, 15:14

                  • Login

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