Provided socket has been destroyed
See original GitHub issueHey there!
I’m trying to track down an issue I’m having when running my SRF instances on Amazon through a Network Load Balancer using Outbound Connections.
I’m by no means certain it’s caused by the NLB, but the error I’m getting is: “Provided socket has been destroyed”.
It only seems to happen when I’m using the Simring, so I’m looking for some insight into the internal workings of the SRF framework.
The error is caused in drachtio-agent.js on this line:
assert.ok(params.socket.destroyed !== true, 'provided socket has been destroyed');
Here is an excerpt of my code.
const register = await registrar.getNextRegistration(user, 10000); //Wait for up to 10 seconds for a new registration to happen.
if (!register) {
info(`No registration happened within timeout for ${user}`);
res.send(404, () => endSrf()); //===== THIS WORKS! ======
return;
}
const simring = new Simring(req, res, [register.contact], {
proxyResponseHeaders: [],
headers: {
"from": req.headers.from
},
localSdpB: sdp,
localSdpA: getSdpA.bind(null, {
'call-id': req.get('Call-Id'),
"via-branch": via.params.branch,
'from-tag': from.params.tag
}, rtpEngineHost)
});
try {
const {uas, uac} = await simring.start(); //===== THIS IMMEDIATELY FAILS ======
}
catch(err) {
error("Error during simring: " + err, err);
endSrf();
}
Essentially I’m wondering what causes that error. It doesn’t appear that the Outbound Connection has been torn down, as the res.send(404, () => endSrf());
works every time. It’s only Simring.start() that throws this error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
@davehorton your patch seems to have done the trick! I’m now running it with the health checks being directed at the SRF port, and everything appears to be working.
Excellent!