Skip to content

Question about the purpose of socket.pings and its necessity #94

@Madriix

Description

@Madriix

Hi,

Since this afternoon, I have commented out the following code in Server.js:

socket.pings = setInterval(function () {
    if (socket.lastping.length > 0) {
        socket.end();
    }
    socket.lastping = Date.now() + ".jbnc";
    if (socket.writable)
        socket.write("PING :" + socket.lastping + "\n");
    else {
        clearInterval(socket.pings);
        socket.end();
    }
    if (global.DEBUG) {
        console.log("PING :" + socket.lastping + "\n");
    }
}, global.BOUNCER_SHACK * 1000, socket);

I also commented this out in Server.js:

clearInterval(socket.pings);

And this in ClientConnect.js:

clearInterval(this.client.parents[x].pings);

I have not noticed any issues with this connection flow:

  1. Connect to jBNC using mIRC
  2. jBNC is connected to UnrealIRCd 6.2.1 (with a pingfreq of 180 seconds in the Class block)
  3. You stay online, or you /quit (leaving jBNC running in the background).
    There are no issues even with the removal of socket.pings.

I ran the same test using a web client based on irc-framework, and no problems were detected either.

What is the purpose of socket.pings? What was it originally added to prevent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions