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. QT QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
Forum Updated to NodeBB v4.3 + New Features

QT QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
25 Posts 4 Posters 9.5k Views 2 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 26 Apr 2018, 21:01 last edited by
    #21

    It would rather be: do your blocking input in one thread and manage your network in another one.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    J 1 Reply Last reply 27 Apr 2018, 05:37
    0
    • S SGaist
      26 Apr 2018, 21:01

      It would rather be: do your blocking input in one thread and manage your network in another one.

      J Offline
      J Offline
      JadeN001
      wrote on 27 Apr 2018, 05:37 last edited by JadeN001
      #22

      @SGaist thanks very much
      I followed your suggestion and now it seems like , I'm getting this notification only when I write() something. @SGaist Is there a way to get the current SocketNotifier and handle it ?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 27 Apr 2018, 06:18 last edited by
        #23

        You might be interested by this small example for reading std using Qt.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        J 1 Reply Last reply 27 Apr 2018, 11:22
        0
        • S SGaist
          27 Apr 2018, 06:18

          You might be interested by this small example for reading std using Qt.

          J Offline
          J Offline
          JadeN001
          wrote on 27 Apr 2018, 11:22 last edited by
          #24

          @SGaist thanks very much
          I tried this way too, but here I must pass the socketDescriptor as a parameter in QSocketNotifier. Its a bit confusing on client side how we can get socketDescriptor as in my knowledge we can only get socketdescriptor at serverside because of its Incommingconnection(). now, One more thing....Is it possible to get a warning of socket Notifier because reading and writing functions are being called at the same time ??
          0_1524828143661_op.png

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 27 Apr 2018, 21:06 last edited by
            #25

            The socket notifier was only for stdin. As for your client side network connection, do everything in your dedicated worker object.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            21/25

            26 Apr 2018, 21:01

            • Login

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