pushrax / node-rcon

A generic RCON protocol client for node.js
MIT License
134 stars 31 forks source link

Error: This socket has been ended by the other party #15

Closed iDentity1337 closed 3 years ago

iDentity1337 commented 8 years ago

75% of the time when I submit my request to the server, this error throws: Missing error handler on socket. Error: This socket has been ended by the other party at Socket.writeAfterFIN as write at Rcon._sendSocket (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/rcon/node-rcon.js:76:21) at Rcon.send (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/rcon/node-rcon.js:71:8) at Socket. (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/app.js:67:22) at Socket.emit (events.js:104:17) at Socket.onevent (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/socket.io/lib/socket.js:335:8) at Socket.onpacket (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/socket.io/lib/socket.js:295:12) at Client.ondecoded (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/socket.io/lib/client.js:193:14) at Decoder.Emitter.emit (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/socket.io/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20) at Decoder.add (/var/sentora/hostdata/zadmin/public_html/csgomatches_net/CSGMPanel/CSGMServer/node_modules/socket.io/node_modules/socket.io-parser/index.js:247:12)

Is this node-rcon sided or socket.io sided?

pushrax commented 8 years ago

It would appear that the game server is closing the TCP connection that's being used for RCON.

Are you creating a single instance of Rcon and using that on every request? If there is a long delay between requests I could imagine something like this might happen.

iDentity1337 commented 8 years ago

Yes, I am using it on every request. I've added an interval to send ping command every 5 seconds, maybe that will work as a temporary workaround?

pushrax commented 8 years ago

That might be a good idea in general. If that fixes your problem I'll add it as a recommendation in the README. Alternatively you can create a new Rcon instance for each request.

iDentity1337 commented 8 years ago

Didn't notice any crashes after, will test a bit more tomorrow and get to you back with results

TropicSapling commented 8 years ago

Results?

TropicSapling commented 8 years ago

Also add that as recommendation to readme?

iDentity1337 commented 8 years ago

was inactive, still happens sometimes but not much as before

TropicSapling commented 8 years ago

Ok, are you pinging every 5 seconds?