diff --git a/doc/design.txt b/doc/design.txt index 0e38062..e91568f 100644 --- a/doc/design.txt +++ b/doc/design.txt @@ -13,7 +13,7 @@ Contents * Motivation * Design goal * Functional requirements - * Comments on the functional requirements + @@ -83,33 +83,6 @@ Minimally, I'd like to support: - OpenMCL -The lifetime of a socket can be described with these steps: - - 1. Socket creation (socket() function) - 2. Socket initializaiton (setsockopt(), bind() and listen()/connect() funcs) - 3. Socket use (accept() / recv[from], send[to]) - 4. Socket termination (shutdown()) - 5. Socket destruction (close()) - -While for most applications steps 1-3 can be condensed into 1 (which most -implementations do), if the library wants to be extensible into other -domains than IP, a means should be provided to do socket initialization -without knowing what parameters to accept beforehand: other protocols -require parameters for setsockopt we will not know about in advance. - -There are several possibilities to address this issue: - - a. Force the 3 steps apart [hard to get done with the current status - for some implementations, as they are currently integrated in the - public interface]. - b. Find a mechanism to pass options which we want setsockopt to - be called with. Problem: what to do with implementations which - don't support setting of all options *before* the bind() call? - Does it matter that some options may be set after the bind() - call? What if they're not set before connect() [buffer size changes - have to be set before connect()]? - c. ... ? - Comments on the design above ============================ diff --git a/notes/accept-apis.txt b/notes/accept-apis.txt deleted file mode 100644 index e61aed2..0000000 --- a/notes/accept-apis.txt +++ /dev/null @@ -1,173 +0,0 @@ - - -*- text -*- - -Part of 'Step 3': Server/passive tcp socket interfaces supplied by -the different implementations in order to provide the same externally. - - -ABCL -==== - - - ext:make-server-socket port - - ext:socket-accept socket - - ext:socket-close socket - -Allegro -======= - - - socket:make-socket :type :stream :connect :passive - :local-port :reuse-address t :backlog - :local-host - - socket:accept-connection sock &key wait - - close - - -clisp -===== - - - socket:socket-server &optional port &key interface backlog - - socket:socket-server-close sock - - socket:socket-server-host sock - - socket:socket-server-port sock - - socket:socket-accept sock &key element-type external-format buffered timeout - - socket:socket-options sock &rest options - -... and ofcourse, there's the raw-sockets - -CMUCL -===== - - - ext:create-inet-listener port &optional kind - &key reuseaddress backlog interface - - ext:accept-tcp-connection socket - - -LispWorks -========= - - - comm::get-fd-from-socket (socket-os-fd lispworks-socket) - - comm::create-tcp-socket-for-service port - (may use comm::*use_so_reuseaddr* for that socket option) - misses the ability to specify an interface to bind to. - - comm::socket-close - - -OpenMCL -======= - - - openmcl-socket:accept-connection - - openmcl-socket:make-socket :local-host :local-port port - :reuse-address t :type :stream :connect :passive - :backlog - - close - - -SBCL -==== - - - make-instance 'inet-socket - - sb-bsd-sockets:sockopt-* - - sb-bsd-sockets:socket-bind - - sb-bsd-sockets:socket-listen - - sb-bsd-sockets:socket-accept - - -;; -;; -;; The above APIs are good enough to implement a simple -;; accept interface, but doesn't give access to specifying -;; socket options before the socket is bound to the interface -;; ==> This may only actually be required for SO_REUSEADDRESS?!??? -;; -;; The other option would be to use lots of FFI - where needed - -;; and use the (mostly internal) glue routines from the implementations - - -ABCL -==== - - With ABCL - lacking a good sockets API - it's still possible to implement - whatever we need to get good access... - - -Allegro -======= - - Hmm. The accept function in this implementation does not allow limiting - connections to a given host/ip, but it does allow to create sockets - with mostly the right options. - - Is that enough reason to do this entirely in ffi?! - - Also, doing this in FFI would require to reverse engineer the creation - of socket streams. Maybe Franz tech support could help there though. - - Need to investigate the IPC_* symbols an the sockets package: - there are lots of functions which look like they should be useable. - - -clisp -===== - - This implementation allows access to the full sockets as described - in http://clisp.cons.org/impnotes/rawsock.html. - - -CMUCL -===== - - Provides (in unix package): - - - unix-accept - - unix-bind - - unix-listen - - unix-socket - - Provides (in extentions): - - - inet-sockaddr - - get-socket-option - - set-socket-option - - create-inet-listener port &key host reuse-address backlog - - -LispWorks -========= - - The implementation provides a lot of undocumented functions the library - could tap into: - - - comm::socket - - comm::bind - - comm::accept - - comm::getsockopt - - comm::setsockopt - - comm::initialize-sockaddr_in (helper) - - comm::streams-from-fd (helper) - - -OpenMCL -======= - - - make-socket provides all options which we'll need to set, - it doesn't however provide access to [gs]etsockopt... - - -SBCL -==== - - provides (in sb-bsd-sockets): - socket-bind - socket-accept - sokcet-listen - - provides (in sb-bsd-sockets-internal [sockint]): - getsockopt - setsockopt - - SO-* constants - TCP-* constant(s) - AF-* constants (and, since AF-* == IF-*, we don't need others) - - -