0

Can a BusAttachment join two or more sessions at the same time?

asked 2014-07-28 07:43:54 -0800

this post is marked as community wiki

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

Now I am working at a project where I want to "change" the session to a room,which means the client can get some messages(the activity name of the session) besides the name of session. That is what I think:The server should bind two sessions,the first will send the messages of the room to clients,then if the client is interested in the room,it will join the second session,which means it joins the activity in the room. But I don't know how to implement this.I don't know whether I should bind one or two BusObject on the BusAttachment.If the answeer is two,I don't know I should declare one or two BusInterface... Please help me,thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-28 12:16:41 -0800

stevek gravatar image

BusAttachments, BusObjects, Interfaces, and Sessions are all independent from each other. You only need one BusAttachment to communicate on the bus. Any more would be superfluous and would likely cause confusion.

A BusAttachment can have any number of BusObjects. Each BusObject can implement any number of Interfaces. In fact, multiple BusObjects can implement the same interface. You can think of a BusObject as a representation of a specific instance of a resource on the bus.

Sessions are completely unrelated. They serve 2 purposes:

  1. Maintain connection reference count so that the routing node know when to drop connections.
  2. Provide routing path for signals without an explicit destination.

I may be reading your question wrong, but it sounds like you want to use one signal to advertise the "room" to other devices that may be interested in the activities of that "room". If that is correct, then I think you will want to look at using the About functionality to advertise the room. That is the standard AllJoyn way to let others know about the service you are providing. Once other clients get the About message they can connect to your session and receive the activity messages.

edit flag offensive delete publish link more

Comments

Thank you,my comment is too late

letingoo ( 2014-09-23 00:06:55 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-07-28 07:43:54 -0800

Seen: 95 times

Last updated: Jul 28 '14