I'm using the net.Socket
module to connect to EFNET and testing my code in order to add a reconnect event to my bot.
What are some ways I can mimic the bot disconnecting? The issue is very 2-3 weeks it disconnects - I have added event handlers in order to understand which happens when it disconnects from IRC:
irc = {
info:{}
, listeners : []
, socket : new net.Socket()
}
irc.socket.on('timeout', function() {
console.log('timeout');
});
irc.socket.on('error', function() {
console.log('error');
});
irc.socket.on('end', function() {
console.log('end??')
setTimeout(function() {
//irc.socket.connect(config.server.port, config.server.addr);
}, 1000 );
});
Or if anyone has knowledge on which actual event happens usually with relating to irc bots, I'd appreciate it.
EDIT #1: Maybe I could I do something with iptables
and filter the port while it's running or something along those lines?