[usocket-devel] Support for Server Connections

Erik Huelsmann ehuels at gmail.com
Sun Oct 22 08:27:15 UTC 2006


On 10/21/06, nick thomas <jesuswaffle at gmail.com> wrote:
> Here's a patch (based on svn) which implements some of the
> modifications discussed. Specifically, it fixes *DEFAULT-BACKLOG-SIZE*
> and factors out the common parts of USOCKET and USOCKET-SERVER to a
> base class, USOCKET-BASIC, and makes various API changes (none which
> break backcompat with 0.1.0, of course) to accomodate the new scheme.
> Also, for symmetry, I rename USOCKET to USOCKET-PEER, with USOCKET as
> a deprecated alias.

Nice. I started on implementing this too, but then decided I needed to
understand the problem domain better, so I wrote down (some) of what I
have in my head regarding the final class structure.

Unfortunately, I didn't get much further than this:

Class structure
===============

 usocket
  |
  +- datagram-usocket
  +- stream-usocket
  \- stream-server-usocket

The usocket class will have methods to query local properties, such
as:

 - get-local-name: to query to which interface the socket is bound
 - <other socket and protocol options such as SO_REUSEADDRESS>


In my implementation, I renamed usocket to stream-usocket. Then I
moved the socket slot from stream-usocket to the new usocket
superclass.

If all internal consumers are adjusted to create stream-usockets, then
that should be backward compatible too, iff external libraries don't
directly create usocket instances, that is....

Because we're pre-1.0, I don't want to introduce too much
compatibility cruft yet. How about adding a section 'Pre-1.0 Interface
guarantees'? I'd like to guarantee socket-connect for the total
life-time pre-1.0 and I'd like to guarantee that on the socket class
it creates, you can call the different get-* methods, as well as use
the 'socket' and 'stream' accessors.
Shouldn't that be enough to guarantee 'normal' use? If you agree with
that, I think we can rename usocket-basic -> usocket and usocket-peer
-> stream-usocket. Apart from that, the patch should be good. (I can
do the renames locally, no need for resubmission!)

Your patch includes #FIXME comments about :external-format. I had some
discussions about that on IRC and will send a separate mail on the
subject.


Thanks for thinking with me!

bye,

Erik.



More information about the usocket-devel mailing list