Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor cosmetics + fixed issue #45 #44

Merged
merged 2 commits into from

2 participants

@microp11
Collaborator

Minor cosmetics + fixed issue #45

microp11 added some commits
@microp11 microp11 There is an indication of a bug either in the implementation of the s…
…erver or of the client.

The socket.io connection still seems to remain active.
This will just kill the symptoms from a user perspective, the bug is still there.
45d88d5
@microp11 microp11 Fixed issue #45. By setting the option {'reconnect': false} on initia…
…l socket connect, after a disconnect there is no automatic reconnect attempt from the socket.io client.

Removed the flag and the associated code.
92c2cbf
@alejandro alejandro merged commit 61c1670 into nodester:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2012
  1. @microp11

    There is an indication of a bug either in the implementation of the s…

    microp11 authored
    …erver or of the client.
    
    The socket.io connection still seems to remain active.
    This will just kill the symptoms from a user perspective, the bug is still there.
Commits on Apr 10, 2012
  1. @microp11

    Fixed issue #45. By setting the option {'reconnect': false} on initia…

    microp11 authored
    …l socket connect, after a disconnect there is no automatic reconnect attempt from the socket.io client.
    
    Removed the flag and the associated code.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 13 deletions.
  1. +3 −13 public/js/app.js
View
16 public/js/app.js
@@ -4,7 +4,6 @@ $(document).ready(function() {
nickname = null,
nicks = [], //could be an object if later we decide to add the nick attributes (+,... @)
webNicks = [], //web irc users
- doNotReconnect = false, //prohibit reconnect to nodester server after a socket disconnect, no retries
motdPrevLineEmpty = false, //flag for determining if the prev motd line was only spaces and asterisks
//html elements
textInput = $('#text_input'),
@@ -116,7 +115,6 @@ $(document).ready(function() {
joinForm.on('submit', function(e) {
e.preventDefault();
- doNotReconnect = false;
if (nickText.val() !== '') {
loginWrong.addClass('off');
loginMsg.removeClass('off');
@@ -124,7 +122,7 @@ $(document).ready(function() {
if (sock !== null && sock.socket.connected === false) {
sock.socket.reconnect();
} else {
- sock = io.connect('http://' + window.location.host);
+ sock = io.connect('http://' + window.location.host, {'reconnect': false});
sock.on('message', handleMessage);
sock.on('disconnect', handleDisconnect);
sock.on('connect', handleConnect);
@@ -405,8 +403,8 @@ $(document).ready(function() {
requestWebUsers();
}
var header_class = (c.getStatsEnabled() == true) ? 'header-stats' : 'header-stats off';
- nickLabel.html('<span class="'+header_class+'">Server up for: ' + c.getServerTime()
- + ', mem: ' + c.getMinRss() + '/' + c.getMaxRss() + 'MB</span> ' + nickname);
+ nickLabel.html('<span class="'+header_class+'">Server up for ' + c.getServerTime()
+ + ', using ' + c.getMinRss() + '-' + c.getMaxRss() + ' MB of RAM</span> ' + nickname);
break;
case "webusers":
webNicks = obj.wu;
@@ -422,10 +420,6 @@ $(document).ready(function() {
};
var handleConnect = function () {
- //cancel reconnect
- if (doNotReconnect == true) {
- return;
- }
loginMsg.text("");
loginStatus.html("");
var nick = window.nick = getNickname(nickText.val());
@@ -440,13 +434,9 @@ $(document).ready(function() {
/*
* set a time delay for disconnect
- *
* in case we exit the form we do not want the user to see it
- * the socket has a reconnect timeout that does not help us with irc here
- * so we make sure the socket won't reconnect: doNotReconnect = true
*/
var handleDisconnect = function () {
- doNotReconnect = true;
setTimeout( function () {
appendEvent("*", "disconnected", false);
nicks = [];
Something went wrong with that request. Please try again.