Skip to content

Joining an AllJoyn Session

michiyosony edited this page Apr 20, 2015 · 1 revision

After connecting to the bus, an AllJoyn session can be connected to using

bus.joinSession(success, error, service)

####success The first parameter is the success callback. It receives the session object as a parameter. The session may be stored for use outside the callback.

function(session) {
  // do something with the session
}

error

The second parameter is the failure callback. It receives the status as a parameter.

function(status) {
  // do something about the error
}

service

The third parameter is the service object. A service object contains two properties: the service name and the port on which the session will take place:

var service = {
  name: "name.of.the.service",
  port: 12
};

The name and port values should match those passed to the startAdvertisingName method.

Clone this wiki locally