Is there a way to integrate the Thin Core with event loops?

asked 2015-07-30 06:43:47 -0700

iamwillj gravatar image

updated 2015-07-30 09:34:12 -0700

mathewm gravatar image

Hi All,

I'm working on an Alljoyn service using the Thin Core, and I wanted to request a feature that shouldn't be too difficult, but will add much to the Thin Core.

I would like to be able to request a socket (or file descriptor, whatever you want to use) from a bus attachment that can be used with select() to be notified when data is available. This way, when an application is waiting for signals from multiple places (ie, alljoyn, the device itself, etc.), it doesn't have alternate pollings, or create separate threads; rather it can all be handled within the same select() call.

AJ_Status AJ_GetDescriptor(AJ_BusAttachment* bus, int* descriptor); could be an example where the file descriptor is set in the descriptor value.

I've temporarily done this (for a Linux platform) for my solution via: int ajSocket = ((int)bus->sock.rx.context); Since I know from target/linux/aj_net.c the context really just points to a socket. And, when the descriptor is set, I simply call AJ_UnmarshallMsg() to retrieve the data.


edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-07-30 09:01:40 -0700

mathewm gravatar image

This would definitely make it easier to integrate with event loops. Please create a feature request at https://jira.allseenalliance.org/brow...

edit flag offensive delete publish link more


Thanks for the response (to both questions). I didn't realize my ask forum username/password worked with the Jira site as well. I'll open tickets there for both issues.

iamwillj ( 2015-07-30 09:05:56 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-07-30 06:43:47 -0700

Seen: 42 times

Last updated: Jul 30 '15