Rejoining an AllJoyn Session Using PeerGroupManager

asked 2014-08-07 03:30:25 -0700

rb3 gravatar image

updated 2014-08-07 04:18:09 -0700

I have implemented a proximal whiteboard application using the iOS AllJoyn SDK v14.06 and the accompanying PeerGroupManager module. The following is an example scenario using the app:

  1. A whiteboard session is created.
  2. A peer sees the session and joins it.
  3. Any annotations made on the whiteboard can be seen on all joined peers.

The issue is that when a peer leaves a session and rejoins, PeerGroupManager's -didAddPeer:toGroup:forATotalOf: method is not called. -didRemovePeer:fromGroup:forATotalOf: is also not called when a peer leaves. Furthermore, I found that AJNSessionListenerImpl::SessionMemberAdded and AJNSessionListenerImpl::SessionMemberRemoved are not being called when rejoining the session.

I also noticed that when a peer leaves a session, the following error is printed on the binding peer:

****** ERROR NETWORK iodisp            common/os/posix/Socket.cc:400 | Shutdown socket (sockfd = 110): 57 - Socket is not connected: ER_OS_ERROR

I call the relevant PeerGroupManager methods in the following order to reproduce the bug in my app:

  1. Hosting iPad: -createGroupWithName:, registerBusObject:
  2. Joining iPad: -joinGroupWithName:, getRemoteObjectWithClassName:forPeer:inGroup:onPath:
  3. Joining iPad: -leaveGroupWithName:
  4. Joining iPad: -joinGroupWithName:, getRemoteObjectWithClassName:forPeer:inGroup:onPath:

I have checked that I am unregistering and deallocating the appropriate AJNBusObjects, AJNBusObjectImpls, and AJNProxyBusObjects properly. I am also explicitly deleting the handle in my AJNBusObject subclass dealloc method.

I think this is a known bug (ASACORE-49). How can I get around this for the mean time, without having to recreate the PGMPeerGroupManager on the binding peer every time a peer leaves?

Thank you for your feedback.


I got the following errors after many cycles of Build->Run->Create/Join Session->Leave Session:

****** ERROR NETWORK IpNameServiceImpl common/os/posix/Socket.cc:574 | SendTo (sockfd = 98  addr = ff02::13a  port = 9956): 55 - No buffer space available: ER_OS_ERROR
****** ERROR IPNS    IpNameServiceImpl .../IpNameServiceImpl.cc:3277 | IpNameServiceImpl::SendProtocolMessage():  Error sending to IPv6 Link-Local Scope multicast group : ER_OS_ERROR

After I restarted the iPad, the error went away. Could it be that I'm leaking memory somewhere?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-07 14:10:03 -0700

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Peer Group Manager is a parked project at this time and not officially supported. It is use at your own risk software. It also has not been updated to work with the new 14.06 (nor 14.02 for that matter) API calls for optimizations so there are bound to be issues that come up mixing these version.

Judging by how you have described the issue my assumption would be that the sessionlistener is not being set when the next join session occurs. One thing to try is downgrade to 14.02 and see if the problem is present in that release.

All in all the purpose of Peer Group Manager was to provide a means for developers like yourself to have an easier entry into AllJoyn development. The software itself is just a higher level abstraction above the AllJoyn API calls. You possible could benefit from using the API calls directly and avoiding the Peer Group Manager software.

edit flag offensive delete publish link more


I see, thanks for your feedback. I am planning to replace PGM in the near future. It also occurs with v14.02. Is it the case that the sessionId changes whenever a user is added/removed from the session? If that's the case, do I have to unbind the session listener before I bind to the new ID? Thanks

rb3 ( 2014-08-07 17:04:46 -0700 )edit

The sessionId would only change in the case that the a session is not a multi-point session. But yes each time you have a new sessionId you will need to set a session listener on that ID. For memory management you should remove a listener when you have lost the session, you can also have many active listeners.

bspencer ( 2014-08-14 10:53:08 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-08-07 03:30:25 -0700

Seen: 303 times

Last updated: Aug 07 '14