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. QTcpSocket windows vs android[SOLVED]
Forum Updated to NodeBB v4.3 + New Features

QTcpSocket windows vs android[SOLVED]

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • P Offline
    P Offline
    puksec
    wrote on last edited by
    #1

    Hi,

    I am aware of Qt-s way of dealing with sockets and threads, but I have managed to create app where I am using sockets in threads other than main thread. It works great on windows (no warnings, errors...).

    BUT, when I build from same source for android (arm7) I get "Parent is QTcpSocket(0x5a356720), parent's thread is QThread(0x5a358d78), current thread is QThread(0x5d17f378)" error.

    I know what error is saying, I am just wondering if anyone knows why I get this only on android and not on windows?
    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Because they do not share the same architecture, i.e. android is a linux based system.

      Anyway, you can use socket from another thread, you need to construct it the correct way e.g. following the threaded fortune server example.

      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
      • P Offline
        P Offline
        puksec
        wrote on last edited by
        #3

        Thanks for the reply SGaist. I was desperately trying to avoid signals and slots in communication protocols, but I guess there's a first time for everything :).

        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