# Revision history [back]

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.

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

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.

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

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. 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