mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Adding on error for socket to try to handle disconnect
This commit is contained in:
@@ -57,6 +57,10 @@ io.on('connection', function(socket){
|
|||||||
|
|
||||||
var guid = hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]);
|
var guid = hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]);
|
||||||
|
|
||||||
|
socket.on('close', function() {
|
||||||
|
console.log("closing socket");
|
||||||
|
})
|
||||||
|
|
||||||
socket.on('ping', function() {
|
socket.on('ping', function() {
|
||||||
socket.emit("ok");
|
socket.emit("ok");
|
||||||
});
|
});
|
||||||
@@ -524,6 +528,11 @@ io.on('connection', function(socket){
|
|||||||
left_channel(coll, guid, name, short_id);
|
left_channel(coll, guid, name, short_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('error', function()
|
||||||
|
{
|
||||||
|
left_channel(coll, guid, name, short_id);
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('pos', function()
|
socket.on('pos', function()
|
||||||
{
|
{
|
||||||
check_inlist(coll, guid, socket, name);
|
check_inlist(coll, guid, socket, name);
|
||||||
@@ -533,6 +542,7 @@ io.on('connection', function(socket){
|
|||||||
|
|
||||||
function left_channel(coll, guid, name, short_id)
|
function left_channel(coll, guid, name, short_id)
|
||||||
{
|
{
|
||||||
|
if(coll == undefined || guid == undefined) console.log(coll, guid)
|
||||||
if(lists[coll] !== undefined && contains(lists[coll], guid))
|
if(lists[coll] !== undefined && contains(lists[coll], guid))
|
||||||
{
|
{
|
||||||
var index = lists[coll].indexOf(guid);
|
var index = lists[coll].indexOf(guid);
|
||||||
|
|||||||
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -36,6 +36,7 @@ var Search = {
|
|||||||
url: yt_url,
|
url: yt_url,
|
||||||
dataType:"jsonp",
|
dataType:"jsonp",
|
||||||
success: function(response){
|
success: function(response){
|
||||||
|
console.log(response.items.length);
|
||||||
if(response.items){
|
if(response.items){
|
||||||
//get list of IDs and make new request for video info
|
//get list of IDs and make new request for video info
|
||||||
$.each(response.items, function(i,data)
|
$.each(response.items, function(i,data)
|
||||||
|
|||||||
Reference in New Issue
Block a user