Skip to content

Commit edf87af

Browse files
authored
Possible fix for crash when ECONNRESET at TcprosServer (#177)
add a error handle, incase of crash
1 parent 8aefc93 commit edf87af

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/lib/RosNode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ class RosNode extends EventEmitter {
450450
_setupTcprosServer(tcprosPort=null) {
451451
let _createServer = (callback) => {
452452
const server = net.createServer((connection) => {
453+
connection.on("error",()=>{}) //add this incase of ECONNRESET crash the whole program
453454
let conName = connection.remoteAddress + ":"
454455
+ connection.remotePort;
455456
connection.name = conName;

0 commit comments

Comments
 (0)