I am using the Autobahn JS for creating a connection with Wamp WS version 1. The code used for connection is:
ab.connect(serverUrl,function (session) {
sess = session ;
sess.prefix("event", "abc/");
console.log("Connected to " + serverUrl);
sess.subscribe("event:topicDemo",onMessage);
}
},
function(code, reason){
sess = null;
Console.log("Client disconnected");
}
);
Here the connection is established successfully. But I want to use a mechanism in which I would subscribe to the topic after the connection is established. Plus I want to use the session object in future as per the requirement. (In this case ab.connect works asynchronously, due to which the session object cannot be used in future) Is it possible?
Thanks in advance.