2007/5/9, Erik Huelsmann ehuels@gmail.com:
Hi Mikhail, I'm CC-ing the development list because I've seen this question before and that way it will be available in the archives for posterity. I hope you don't mind.
Sure, but I thought that doesn't refer to the cl-irc because this exception was raised in another thread. But your comments are always useful, thanks.
You need to do 2 additional things to make the connection work:
- You need to add the default hooks for the cl-irc library to work correctly
Oh, didn't know that. Do those default hooks add the ping/pong thing too?
- You need to call read-message-loop on the connection to handle the
incoming IRC messages.
The last one exists at the end of source file already in the separate function. I start it in its own thread.
(defun server-2 () (let ((sock (usocket:socket-listen "88.204.87.138" 3690 :backlog 4 :reuseaddress t))) (setf *serv* sock) (sb-thread:make-thread #'(lambda () (let ((csock (usocket:socket-accept sock))) (let ((cstream (usocket:socket-stream csock))) (when cstream (loop for line = (read-line cstream nil)
Here you may want to check whether the socket is actually still connected before reading from it. See cl-irc:read-message.
What's the relation between cl-irc:read-message and that socket? What is the best way to check the "usocket" connection ?
And one more question about cl-irc: how can I handle "action" messages on the channel?