The use of sessionID and Session port

asked 2015-11-22 19:24:26 -0700

canglang1990 gravatar image

Dear all: I cannot understand the different use of sessionID and session port.I have read the documentation but I cannot understand it.The session have it's port and the service and client have those unique name,why they need the sessionID.And the different between sessionID and session port.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-11-22 20:56:26 -0700

praveenb gravatar image

updated 2015-11-22 20:59:21 -0700

Communication between applications built on top of Client libraries, takes place upon the establishment of a session.

There are two ends in a session. The application on hosting end and the application on joining end.

  • The hosting application sets up or binds to a port, identified by a uint16_t integer termed as sessionPort. This port is completely confined to AllJoyn and has nothing to do with ports in an operating system.
  • The joining application connects to this port. The hosting end then accepts the connection, upon which session has been established.

Session represents a channel of communication between two applications and is identified by a uint16_t integer termed as sessionId. sessionId is one of the fields of AllJoyn message header and gets transmitted over the wire during communication between applications on both ends.

In terms of AllJoyn APIs, the following is the sequence of steps

  1. Hosting application sets up a port via BindSessionPort
  2. Joining application initiates via JoinSession and waits for a reply from Hosting application
  3. Hosting application gets AcceptSession callback, where it specifies its intent to proceed with session establishment
  4. Application on either end can terminate session via LeaveSession
  5. Applications are notified that session has been terminated via SessionLost callback, which gives a reason why the session has been terminated
edit flag offensive delete publish link more


I cannot understand why two different service in a bus can use the sample port. "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.

canglang1990 ( 2015-11-23 18:42:07 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-22 19:24:26 -0700

Seen: 371 times

Last updated: Nov 23 '15