ircanywhere / irc-factory

A rebuilt irc-factory from simple-irc-socket and irc-message. Get support at #ircanywhere on freenode
https://ircanywhere.com
MIT License
60 stars 14 forks source link

What's the preffered way to check if a conenction is still alive? #3

Closed silverbucket closed 10 years ago

silverbucket commented 10 years ago

When I run sockethub on my laptop, and suspend, when it comes back up, sockethub handles my requests find and uses the irc-factory object without any errors as if it was still a live connection, but obviously the connection has been terminated and the message never shows up in IRC.

I was just wondering what would be the best, quickest, way to check for connection state? If the connection is dead, sockethub could re-initialize, then send, without the client needing to know about it.

rickihastings commented 10 years ago

Look into client.irc.isConnected(). Although if you're using the RPC interface, this may not work, I'll look into fixing this later today when I'm free.

On 22 Dec 2013, at 06:35, Nick Jennings notifications@github.com wrote:

When I run sockethub on my laptop, and suspend, when it comes back up, sockethub handles my requests find and uses the irc-factory object without any errors as if it was still a live connection, but obviously the connection has been terminated and the message never shows up in IRC.

I was just wondering what would be the best, quickest, way to check for connection state? If the connection is dead, sockethub could re-initialize, then send, without the client needing to know about it.

— Reply to this email directly or view it on GitHub.