I'm a little concerned with the way that I am currently making connections
to my websocket
.
In one page of my app
I have:
var socket = io.connect('http://my.ip.address' + ':' + '80' + namespace);
socket.on('connect', function () {
socket.emit('join', { room: 'venue_' + venue_id });
});
After this I receive
some data
through the socket
and then move to another page. After this second page runs, I once again return to the first page where the socket
code above runs again.
I am wondering if this is going to cause any kinds of issues? Should I try and connect
at an earlier stage so the connection
is not made multiple times? If so, is it possible to pass the socket
variable through javascript
?
I am using flask-socketio
on the server
.
Thanks for your help.