chickadee » irc » irc:run-message-loop

irc:run-message-loop CONNECTION #!key debug pong filterprocedure

Repeatedly calls irc:wait and irc:process-message. If the keyword argument debug is given and true, then each incoming message will be dumped to the port given by the value of (current-output-port). The keyword argument pong specifies whether automatic processing of PING messages should be done. If yes, then a message handler with the tag ping (a symbol) will be registered as with the following commands:

 (irc:add-message-handler! 
   con
   (lambda (msg)
     (irc:command con (string-append "PONG :" (car (irc:message-parameters msg)))) )
   tag: 'ping
   command: "PING") )

The keyword argument filter can be used to specify a procedure that will be called for each icoming message object (the result will be used for further processing instead).