Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-side timeout #12

Closed
barrucadu opened this issue Jun 12, 2016 · 5 comments
Closed

Client-side timeout #12

barrucadu opened this issue Jun 12, 2016 · 5 comments
Milestone

Comments

@barrucadu
Copy link
Owner

Sometimes yukibot will drop off freenode, but the process will remain running. This means that network-conduit (or something) hasn't noticed the disconnect. A client-side timeout to initiate a disconnect if the server doesn't respond to a message in long enough would solve this.

@Profpatsch
Copy link

Have the same problem here. It just stops receiving messages.

Pretty much makes the library unusable. :(

@barrucadu
Copy link
Owner Author

Is this still a problem with the latest version of irc-client and irc-conduit? I don't think I've seen this behaviour since b0582d6, which got pushed to hackage in version 0.4.2.1.

@Profpatsch
Copy link

I had it a few times, yes. I tested the behaviour of irc-conduit, it doesn’t terminate when the socket doesn’t produce anything; since conduit can only be terminated by downstream pipes, that’s kind of obvious in hindsight. So yes, it should be possible to give irc-client/irc-conduit a timeout.

@siers
Copy link

siers commented Dec 26, 2016

I think I haven't seen it time out idle, thinking that it's still on the server, since I implemented a self-pinger.

https://github.com/siers/zn/blob/master/Main.hs#L64
https://github.com/siers/zn/blob/master/Zn/Pinger.hs

@barrucadu barrucadu added this to the 0.5 milestone Jan 1, 2017
@barrucadu
Copy link
Owner Author

I believe 97a0dbe correctly implements this.

There is a new _timeout field of ConnectionConfig, which defaults to 300 (seconds) and can be set with the timeout lens. If nothing is received from the server for that period of time, the Timeout exception is thrown to the main thread, which interrupts the conduits and disconnects the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants