0

How to stop other user to connect to a channel

asked 2015-01-19 08:28:15 -0800

ashwanik gravatar image

Hello:

I am trying to create an application which will have one to one mapping as in One Host and other client. I created a channel (say Channel1) using one device (A). I joined Channel1 using device (B).

My question is how to stop another device say Device (C) to join Channel1?

Thanks, Ashwani

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-01-20 11:34:01 -0800

Nikhil Dabhade gravatar image

Hi Ashwani,

There are two ways to achieve this. 1. When you bind a session port the isMultipoint option inside SessionOpts should be set to false so that the session hosted becomes a point to point session. This way your single Channel 1 will have only the host A and device B. If device C tries to join the session hosted by A it will be a separate session 2. The session port listener has a callback acceptSessionJoiner in which you either pass true for accepting a joiner or false for rejecting a joiner. You can use this to control who and how many can join a session which is Channel 1 in your case

Hope that helps. Let me know if something is not clear

Nikhil

edit flag offensive delete publish link more

Comments

Thanks Nikhil, I also noticed acceptSessionJoiner getting called when even new device joins a channel. I have one more query. Is there any size limit on the data (say I am sending String) while sending BusSignals.

ashwanik ( 2015-01-20 18:16:31 -0800 )edit

The data limit for AllJoyn signal is (4096 bytes for header + 2^17 bytes for actual data) So in practice you could have data that is 2^17 bytes long if the system supports it.

Nikhil Dabhade ( 2015-01-21 14:47:13 -0800 )edit

Nikhil, the return of "true" from the AcceptSessionJoiner does not guarantee the creation of a session and the subsequent invocation of the SessionJoined _if_ joiner dies somewhere in the middle of the process (verified on v14.12.00a). If one wants to limit the total number of point-to-point sessions handled by the host, how to do it? Sessions can't be counted inside AcceptSessionJoiner because it does not guarantee session creation. But counting sessions inside the SessionJoined also doesn't seem right, because exceeding sessions need to be "kicked out" immediately after they are successfully joined.

hashok ( 2015-02-09 01:17:33 -0800 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-19 08:28:15 -0800

Seen: 56 times

Last updated: Jan 20 '15