November 10, 2001
Portability 2: Sockets

The software I'm porting to CMUCL uses Franz' AllegroServe web server, which is not intended to be portable to other lisps. Luckily Jochen Schmidt has a Portable AllegroServe project that he maintains separately.

One very useful part of that package is an ACL-compatible socket interface for CMUCL. I like the ACL socket interface; It's not fancy or anything, it's just like a nice lisp version of BSD sockets. CMUCL's own socket interface is very low-level, supporting integer file descriptors instead of streams. (Back when I used MCL, I remember thinking that its networking interface had a few minor problems. Like having to call unexported functions to do essential things, not having the ability to ask the system to bind a socket to a local port that is known to be free, and not having an equivalent to the BSD socket concept of allowing queued connections.)

I am currently facing a situation where the socket compatibility code is not compatible enough, however. I have some code that looks like

(handler-case (read-and-handle-flap self :block-p T)
  (socket-error (e)
    (warn "AIM connection got the following error: ~A." e)
    (setf continue-p (handle-disconnection self))))

which wants to handle errors of type socket-error specially. Unfortunately CMUCL signals errors of type simple-error in situations in which ACL signals socket-error, for example when a hostname cannot be resolved to an IP address.

It probably wouldn't be too hard to create a unified socket function interface across common lisp implementations. What I bet would be harder is making sure that each one implements the exceptional situations that are so important when using sockets in the same way.

What to do.

Posted by jjwiseman at November 10, 2001 02:13 PM

Dan Barlow is working on a socket library:

Posted by: jjwiseman on January 23, 2002 11:23 PM
Post a comment

Email Address:


Unless you answer this question, your comment will be classified as spam and will not be posted.
(I'll give you a hint: the answer is “lisp”.)


Remember info?