Paste number 313413: | mainloop |
Pasted by: | phf |
When: | 8 years, 11 months ago |
Share: | Tweet this! | http://paste.lisp.org/+6PTX |
Channel: | None |
Paste contents: |
(loop
(let* ((td (- (get-universal-time) (or *last-pong* 0))))
(setq *connection-state*
(ecase *connection-state*
(:connected (cond ((>= td 30) :needs-ping)
(t :connected)))
(:needs-ping (ignore-errors (irc:ping *connection* (prin1-to-string ts)))
:waiting-ping)
(:waiting-ping (cond ((< td 30) :connected)
((> td 60) :disconnect)
(t :waiting-ping)))
(:disconnect (ignore-errors (irc-disconnect *connection*))
(mp:destroy-process *connection-event-process*)
:disconnected))))
(sleep 1))
This paste has no annotations.