[usocket-devel] Re: usocket backend/allegro.lisp

Erik Huelsmann ehuels at gmail.com
Tue Jan 23 09:19:05 UTC 2007


> >> Should usocket return nil in this case, or raise an error?
> >
> > That's a good point. Well, I guess it should raise an error: the
> > interface contract specifies it to return a socket and the interface
> > contract for the returned socket is to contain an implementation
> > defined socket reference. Since we can't return a valid socket, I
> > guess socket-connect should raise 'unknown-error...
>
> I think that's right, as well.  The problem with the current behavior is
> that the actual crash (when some code attempts to do something with the
> alleged socket of NIL) can come at an arbitrary distance from the actual
> error (returning NIL instead of a socket), making code that uses usocket
> more difficult to debug than necessary.
>
> Should there be a more specific error class??

I created 2 new errors: invalid-socket-error and
invalid-socket-stream-error. These are raised when an implementation
tries to create a socket with invalid (= NIL) slots for 'socket' or
'socket-stream' respectively. (This is still on trunk btw, I'll
release 0.3.1 when we accumulate fixes or when enough time passes
without accumulating new problems.)

> > Having replicated behavior would be great! That way I'd be able to
> > check for the same behavior in the other backends (and maybe in other
> > allegro versions).
>
> OK, I'll see what I can do.  I was flailing around with beirc, so I may
> not be able to replicate this that easily (and, of course, a simple
> invocation of cl-irc, w/o involving beirc would make a better test case).

bye,

Erik.



More information about the usocket-devel mailing list