The session port

asked 2015-11-23 18:45:05 -0700

canglang1990 gravatar image

I cannot understand why two different service in a bus can use the sample port.image description "Note that the session port is unique only within the context of a particular bus attachment, so the other bus attachment in the figure may also use 42 as its contact port as shown."I cannot understand this sentence.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-11-25 02:10:27 -0700

praveenb gravatar image

All communication between applications built using AllJoyn client libraries takes place via Sessions. For every session, there is a hosting end (provider) and there is a joining end (seeker). The routing nodes manage sessions and inform applications when remote ends establish / leave a session.

The steps in a session establishment are (assume Alice is :1.2 and Bob is :1.4):

  • Alice binds a session port, 42 (uint16_t integer). Session port is part of the About announcement.
  • Bob receives the About announcement and comes to know the session port, 42.
  • Bob joins a session to that port, 42.
  • Alice accepts the session establishment request

In the above, Alice is the provider and Bob is the seeker. Alice, the provider, is the owner of this session port (42).

AllJoyn is a peer-peer to message-based communication framework. Hence, the terms provider / seeker are used primarily for the sake of understanding / clarity. For instance, in the above example, there is nothing that prevents Bob to be a provider in addition to being a seeker. In such a scenario, Bob needs a session port for others to establish sessions with him. Suppose, Bob used session port number 42. This session port, whose number is 42, would be owned by Bob.

When Charlie wants to establish a session with Alice, he invokes JoinSession API for :1.2 and 42. If Charlie wishes to establish a session with Bob, he invokes JoinSession API for :1.4 and 42.

The text that you refer is indicating that the session port numbers owned by Alice and Bob can be same. That is fine, because Alice and Bob own two different/separate session ports. It just so happens that the session port number is identical. Because the bus attachments (corresponding to Alice and Bob) owing the session ports are different, there is no ambiguity even though the session port numbers on both are identical.

edit flag offensive delete publish link more


Tank you very much! But I can't catch the packet which have the session port.It's only have the TCP port.

canglang1990 ( 2015-11-26 03:04:47 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-23 18:45:05 -0700

Seen: 466 times

Last updated: Nov 25 '15