Skip to content

Connection hangs on auth and commands. #18

@knightzac19

Description

@knightzac19

For some reason when connecting to my RCON server the authorization hangs forever.

I narrowed it down to lines 53-55 of the index.js. For some reason that promise is hanging forever and it just ends up timing out at some point. I pulled the _init out of there and commented out the promise and it connects instantly and runs commands without any issue.
return connection.getData(dataHandler).then(() => { _init(connection); });

I also found that if I don't provide a timeout for the rcon.command function it also just sits there and hangs for at least 5-10 seconds and then returns the buffer. If I provide at least a 1000ms timeout it runs instantly.

Node version: 6.2.2
Node-srcds-rcon version: latest
RCON Game: Ark Survival Evolved

Code being used,
rcon.connect().then(function(){ console.log("Connected!"); rcon.command('getchat',1000).then((test) => { console.log("chat ",test); }); });

Update: Did a little more digging because I started having more issues and found a packet getting thrown in with my rcon request. Found these on lines 87-92 and 100-102 of the index.js causing issues.

let ackId = _getNextPacketId(); let ack = packet.request({ id: ackId, type: packet.SERVERDATA_EXECCOMMAND, body: '' });
and
if (res.id === ackId) { return false; } else if (res.id === reqId) {

Seems like every time the "getData" function gets sent a false variable it just hangs terribly as well. I've since commented out the first part and the first if statement. Everything connects/returns within less than a second now, both on my local server and my remote server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions