Skip to content

Commit

Permalink
Fix Socket events in Erizo Client (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Sep 28, 2017
1 parent 95dc9e4 commit 21e4b87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions erizo_controller/erizoClient/src/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ const Socket = (newIo) => {
that.state = that.RECONNECTING;
return;
}
emit.bind(that, 'disconnect');
emit('disconnect', reason);
socket.close();
});

socket.on('connection_failed', () => {
Logger.error('connection failed, id:', that.id);
emit.bind(that, 'connection_failed');
emit('connection_failed');
});
socket.on('error', (err) => {
Logger.warning('socket error, id:', that.id, ', error:', err.message);
emit.bind(that, 'error');
emit('error');
});
socket.on('connect_error', (err) => {
Logger.warning('connect error, id:', that.id, ', error:', err.message);
Expand Down Expand Up @@ -135,7 +135,7 @@ const Socket = (newIo) => {
socket.on('reconnect_failed', () => {
Logger.warning('reconnect failed, id:', that.id);
that.state = that.DISCONNECTED;
emit.bind(that, 'disconnect');
emit('disconnect', 'reconnect failed');
});

// First message with the token
Expand Down

0 comments on commit 21e4b87

Please sign in to comment.