Change alt socket to socketio xhr-polling
This commit is contained in:
parent
07795feffa
commit
5a5016fd79
4 changed files with 17 additions and 39 deletions
|
|
@ -478,7 +478,7 @@ function showOptionsMenu() {
|
|||
addOption("Send Button", sendbtncontainer);
|
||||
|
||||
var altsocketcontainer = $("<label/>").addClass("checkbox")
|
||||
.text("Use alternative socket connection");
|
||||
.text("Use alternative socket connection (requires refresh)");
|
||||
var altsocket = $("<input/>").attr("type", "checkbox")
|
||||
.appendTo(altsocketcontainer);
|
||||
altsocket.prop("checked", USEROPTS.altsocket);
|
||||
|
|
@ -594,24 +594,6 @@ function applyOpts() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(USEROPTS.altsocket) {
|
||||
if(!socket.nws) {
|
||||
if(socket && socket.disconnect)
|
||||
socket.disconnect();
|
||||
socket = new NotWebsocket();
|
||||
setupCallbacks();
|
||||
}
|
||||
}
|
||||
// Switch from NotWebsocket => Socket.io
|
||||
else if(socket && typeof socket.poll !== "undefined") {
|
||||
try {
|
||||
socket = io.connect(IO_URL);
|
||||
setupCallbacks();
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
applyOpts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue