Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Can't schedule EASession in (non-main) run loop?

Can't schedule EASession in (non-main) run loop?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 255 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.
  • W Offline
    W Offline
    wumpus7
    wrote on last edited by wumpus7
    #1

    Howdy,

    I've inherited some code that communicates with an external accessory device using EASession (iOS only). The main app communications method is via sockets wirelessly; a separate 'comms' thread is spun off for handling all I/O streams.

    A part of the standard Objective C code for external accessory communications goes like this:

    ...

    [[session inputStream] setDelegate:self];
    [[session inputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
    [[session inputStream] open];
    

    ...

    The problem that I'm investigating is that 'currentRunLoop' doesn't work in our environment where the EASession is created on the comms thread. It does work if I change to 'mainRunLoop', but that should mean that the external accessory is now bridging the main (GUI) thread and the comms thread.

    I'm having trouble tearing down and recreating the EASession, and it looks like the sticking point is that I can't successfully 'removeFromRunLoop' during teardown. The iOS version of the app doesn't have trouble, but it only uses one thread (per iOS design principles).

    Of particular concern: do I need to kick off the event loop in my comms thread? The documentation I've read seems to suggest that it is automatically started when I call start() on the thread object, but other parts of the documentation suggest that I need to do more?

    Thanks,
    Alex

    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