From ehuelsmann at common-lisp.net Fri Jan 27 23:05:45 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 27 Jan 2006 17:05:45 -0600 (CST) Subject: [usocket-cvs] r1 - public_html usocket usocket/branches usocket/tags usocket/trunk usocket/trunk/backend usocket/trunk/doc usocket/trunk/test Message-ID: <20060127230545.770082A018@common-lisp.net> Author: ehuelsmann Date: Fri Jan 27 17:05:41 2006 New Revision: 1 Added: public_html/ public_html/index.shtml public_html/project-name public_html/style.css usocket/ usocket/branches/ usocket/tags/ usocket/trunk/ (props changed) usocket/trunk/LICENSE usocket/trunk/Makefile usocket/trunk/README usocket/trunk/backend/ (props changed) usocket/trunk/backend/allegro.lisp usocket/trunk/backend/clisp.lisp usocket/trunk/backend/cmucl.lisp usocket/trunk/backend/lispworks.lisp usocket/trunk/backend/sbcl.lisp usocket/trunk/condition.lisp usocket/trunk/doc/ usocket/trunk/doc/allegro-socket.txt usocket/trunk/doc/clisp-sockets.txt usocket/trunk/doc/cmucl-sockets.txt usocket/trunk/doc/errors.txt usocket/trunk/doc/lw-sockets.txt usocket/trunk/doc/openmcl-sockets.txt usocket/trunk/doc/sb-bsd-sockets.txt usocket/trunk/doc/usock-sockets.txt usocket/trunk/package.lisp usocket/trunk/test/ (props changed) usocket/trunk/test/package.lisp usocket/trunk/test/test-usocket.lisp usocket/trunk/test/usocket-test.asd usocket/trunk/usocket.asd usocket/trunk/usocket.lisp Log: Initial import as copied off Erik Enge's home dir. Added: public_html/index.shtml ============================================================================== --- (empty file) +++ public_html/index.shtml Fri Jan 27 17:05:41 2006 @@ -0,0 +1,25 @@ + + + + + <!--#include virtual="project-name" --> + + + + + +
+

+
+ +

This is an automatically generated placeholder page: this project + has not yet created a website.

+ +

Back to Common-lisp.net.

+ +
+ Valid XHTML 1.0 Strict +
+ + Added: public_html/project-name ============================================================================== --- (empty file) +++ public_html/project-name Fri Jan 27 17:05:41 2006 @@ -0,0 +1 @@ +usocket Added: public_html/style.css ============================================================================== --- (empty file) +++ public_html/style.css Fri Jan 27 17:05:41 2006 @@ -0,0 +1,54 @@ + +.header { + font-size: medium; + background-color:#336699; + color:#ffffff; + border-style:solid; + border-width: 5px; + border-color:#002244; + padding: 1mm 1mm 1mm 5mm; +} + +.footer { + font-size: small; + font-style: italic; + text-align: right; + background-color:#336699; + color:#ffffff; + border-style:solid; + border-width: 2px; + border-color:#002244; + padding: 1mm 1mm 1mm 1mm; +} + +.footer a:link { + font-weight:bold; + color:#ffffff; + text-decoration:underline; +} + +.footer a:visited { + font-weight:bold; + color:#ffffff; + text-decoration:underline; +} + +.footer a:hover { + font-weight:bold; + color:#002244; + text-decoration:underline; } + +.check {font-size: x-small; + text-align:right;} + +.check a:link { font-weight:bold; + color:#a0a0ff; + text-decoration:underline; } + +.check a:visited { font-weight:bold; + color:#a0a0ff; + text-decoration:underline; } + +.check a:hover { font-weight:bold; + color:#000000; + text-decoration:underline; } Added: usocket/trunk/LICENSE ============================================================================== --- (empty file) +++ usocket/trunk/LICENSE Fri Jan 27 17:05:41 2006 @@ -0,0 +1,23 @@ +(This is the MIT / X Consortium license as taken from + http://www.opensource.org/licenses/mit-license.html) + +Copyright (c) 2003 Erik Enge + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Added: usocket/trunk/Makefile ============================================================================== --- (empty file) +++ usocket/trunk/Makefile Fri Jan 27 17:05:41 2006 @@ -0,0 +1,9 @@ +# $Id$ +# $Source$ + +clean: + find -name -o -name "*~" -o -name "*.err" -o -name "*.x86f" -o -name "*.lib" -o -name "*.fas" -o -name "*.fasl" -o -name "*.faslmt" -o -name "*.ufsl" | xargs rm + +commit: + make clean; cvs up; cvs ci + Added: usocket/trunk/README ============================================================================== --- (empty file) +++ usocket/trunk/README Fri Jan 27 17:05:41 2006 @@ -0,0 +1,17 @@ + +;; the backends must implement +;; +;; - handle-condition +;; - open +;; - close +;; - listen +;; - accept +;; - read-line +;; - write-sequence +;; - get-host-by-address +;; - get-host-by-name +;; +;; the backend must wrap all calls to its socket functions in a +;; handler-case/bind to make sure handle-condition is called. + +;; open should take either the hostname or an vectorized ip \ No newline at end of file Added: usocket/trunk/backend/allegro.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/allegro.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,34 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (sock:make-socket :remote-host host + :remote-port port))) + +(defmethod close ((socket socket)) + "Close socket." + (sock:close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (sock:lookup-host address)) + +(defun get-host-by-name (name) + (sock:lookup-host name)) Added: usocket/trunk/backend/clisp.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/clisp.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,40 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (socket:socket-connect port host) + :host host + :port port)) + +(defmethod close ((socket socket)) + "Close socket." + (socket:socket-server-close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (handler-case (posix:hostent-name + (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (mapcar #'dotted-quad-to-vector-quad + (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/backend/cmucl.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/cmucl.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,41 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (let* ((socket (ext:connect-to-inet-socket (host-byte-order host) port type)) + (stream (sys:make-fd-stream socket :input t :output t :element-type 'character)) + (usocket (make-socket :socket socket :host host :port port :stream stream))) + usocket)) + +(defmethod close ((socket socket)) + "Close socket." + (ext:close-socket (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-stream socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-stream socket))) + +(defun get-host-by-address (address) + (handler-case (ext:host-entry-name + (ext::lookup-host-entry (host-byte-order address))) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (mapcar #'hbo-to-vector-quad + (ext:host-entry-addr-list + (ext:lookup-host-entry name))) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/backend/lispworks.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/lispworks.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,37 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (comm:open-tcp-stream host port) + :host host + :port port)) + +(defmethod close ((socket socket)) + "Close socket." + (cl:close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (comm:get-host-entry (vector-quad-to-dotted-quad address) + :fields '(:name))) + +(defun get-host-by-name (name) + (mapcar #'hbo-to-vector-quad + (comm:get-host-entry name :fields '(:addresses)))) Added: usocket/trunk/backend/sbcl.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/sbcl.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,48 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + "Connect to `host' on `port'. `host' is assumed to be a string of +an IP address represented in vector notation, such as #(192 168 1 1). +`port' is assumed to be an integer. + +Returns a socket object." + (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket :type type :protocol :tcp)) + (stream (sb-bsd-sockets:socket-make-stream socket)) + (usocket (make-socket :socket socket :host host :port port :stream stream))) + (handler-case (sb-bsd-sockets:socket-connect socket host port) + (condition (condition) (handle-condition condition usocket))) + usocket)) + +(defmethod close ((socket socket)) + "Close socket." + (handler-case (sb-bsd-sockets:socket-close (real-socket socket)) + (condition (condition) (handle-condition condition socket)))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-stream socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-stream socket))) + +(defun get-host-by-address (address) + (handler-case (sb-bsd-sockets::host-ent-name + (sb-bsd-sockets:get-host-by-address address)) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (sb-bsd-sockets::host-ent-addresses + (sb-bsd-sockets:get-host-by-name name)) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/condition.lisp ============================================================================== --- (empty file) +++ usocket/trunk/condition.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,18 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(define-condition usocket-error (error) + ((real-condition + :reader real-condition + :initarg :real-condition) + (socket + :reader socket + :initarg :socket)) + (:report (lambda (c stream) + (format stream "Error (~A) occured in socket: ~A." + (real-condition c) (socket c))))) + Added: usocket/trunk/doc/allegro-socket.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/allegro-socket.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,46 @@ + + +(require :sock) + +accept-connection (sock passive-socket) &key wait Generic function. +dotted-to-ipaddr dotted &key errorp Function. +ipaddr-to-dotted ipaddr &key values Function. +ipaddr-to-hostname ipaddr Function. +lookup-hostname hostname +lookup-port portname protocol Function. +make-socket &key type format address-family connect &allow-other-keys Function. +with-pending-connect &body body Macro. +receive-from (sock datagram-socket) size &key buffer extract Generic function. +send-to sock &key +shutdown sock &key direction +socket-control stream &key output-chunking output-chunking-eof input-chunking +socket-os-fd sock Generic function. + +remote-host socket Generic function. +local-host socket Generic function. +local-port socket + +remote-filename socket +local-filename socket +remote-port socket +socket-address-family socket +socket-connect socket +socket-format socket +socket-type socket + +errors + +:address-in-use Local socket address already in use +:address-not-available Local socket address not available +:network-down Network is down +:network-reset Network has been reset +:connection-aborted Connection aborted +:connection-reset Connection reset by peer +:no-buffer-space No buffer space +:shutdown Connection shut down +:connection-timed-out Connection timed out +:connection-refused Connection refused +:host-down Host is down +:host-unreachable Host is unreachable +:unknown Unknown error + Added: usocket/trunk/doc/clisp-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/clisp-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,16 @@ +http://clisp.cons.org/impnotes.html#socket + +(SOCKET:SOCKET-SERVER &OPTIONAL [port-or-socket]) +(SOCKET:SOCKET-SERVER-HOST socket-server) +(SOCKET:SOCKET-SERVER-PORT socket-server) +(SOCKET:SOCKET-WAIT socket-server &OPTIONAL [seconds [microseconds]]) +(SOCKET:SOCKET-ACCEPT socket-server &KEY :ELEMENT-TYPE :EXTERNAL-FORMAT :BUFFERED :TIMEOUT) +(SOCKET:SOCKET-CONNECT port &OPTIONAL [host] &KEY :ELEMENT-TYPE :EXTERNAL-FORMAT :BUFFERED :TIMEOUT) +(SOCKET:SOCKET-STATUS socket-stream-or-list &OPTIONAL [seconds [microseconds]]) +(SOCKET:SOCKET-STREAM-HOST socket-stream) +(SOCKET:SOCKET-STREAM-PORT socket-stream) +(SOCKET:SOCKET-SERVICE-PORT &OPTIONAL service-name (protocol "tcp")) +(SOCKET:SOCKET-STREAM-PEER socket-stream [do-not-resolve-p]) +(SOCKET:SOCKET-STREAM-LOCAL socket-stream [do-not-resolve-p]) +(SOCKET:SOCKET-STREAM-SHUTDOWN socket-stream direction) +(SOCKET:SOCKET-OPTIONS socket-server &REST {option}*) Added: usocket/trunk/doc/cmucl-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/cmucl-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,56 @@ +http://cvs2.cons.org/ftp-area/cmucl/doc/cmu-user/internet.html + +extensions:lookup-host-entry host + +[structure] +host-entry + + name aliases addr-type addr-list + +[Function] +extensions:ip-string addr + +[Function] +extensions:create-inet-listener port &optional kind &key :reuse-address :backlog :interface + +[Function] +extensions:create-unix-listener path &optional kind :reuse-address :backlog + +[Function] +extensions:accept-tcp-connection unconnected + +[Function] +extensions:accept-unix-connection unconnected + +[Function] +extensions:connect-to-inet-socket host port &optional kind + +[Function] +extensions:connect-to-unix-socket path &optional kind + +[Function] +extensions:add-oob-handler fd char handler + +[Function] +extensions:remove-oob-handler fd char + +[Function] +extensions:remove-all-oob-handlers fd + +[Function] +extensions:send-character-out-of-band fd char + +[Function] +extensions:create-unix-socket &optional type + +[Function] +extensions:create-inet-socket &optional type + +[Function] +extensions:get-socket-option socket level optname + +[Function] +extensions:set-socket-option socket level optname optval + +[Function] +extensions:close-socket socket Added: usocket/trunk/doc/errors.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/errors.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,13 @@ +EADDRINUSE address-in-use-error +EAGAIN interrupted-error +EBADF bad-file-descriptor-error +ECONNREFUSED connection-refused-error +EINTR interrupted-error +EINVAL invalid-argument-error +ENOBUFS no-buffers-error +ENOMEM out-of-memory-error +EOPNOTSUPP operation-not-supported-error +EPERM operation-not-permitted-error +EPROTONOSUPPORT protocol-not-supported-error +ESOCKTNOSUPPORT socket-type-not-supported-error +ENETUNREACH network-unreachable-error Added: usocket/trunk/doc/lw-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/lw-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,16 @@ +http://www.lispworks.com/reference/lwu41/lwref/LWRM_37.HTM + +Package: COMM + +get-host-entry +get-socket-address +get-socket-peer-address +ip-address-string +open-tcp-stream +socket-stream-address +socket-stream-peer-address +start-up-server +start-up-server-and-mp +socket-stream +string-ip-address +with-noticed-socket-stream Added: usocket/trunk/doc/openmcl-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/openmcl-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,27 @@ +http://openmcl.clozure.com/Doc/sockets.html + + make-socket [Function] + accept-connection [Function] + dotted-to-ipaddr [Function] + ipaddr-to-dotted [Function] + ipaddr-to-hostname [Function] + lookup-hostname [Function] + lookup-port [Function] + receive-from [Function] + send-to [Function] + shutdown [Function] + socket-os-fd [Function] + remote-port [Function] + local-host [Function] + local-port [Function] + + socket-address-family [Function] + + socket-connect [Function] + socket-format [Function] + socket-type [Function] + socket-error [Class] + socket-error-code [Function] + socket-error-identifier [Function] + socket-error-situation [Function] + close [method] Added: usocket/trunk/doc/sb-bsd-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/sb-bsd-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,86 @@ +http://www.xach.com/sbcl/sb-bsd-sockets.html + +package: sb-bsd-sockets + +class: socket + +slots: + + * file-descriptor : + * family : + * protocol : + * type : + * stream : + +operators: + + (socket-bind (s socket) &rest address) Generic Function + (socket-accept (socket socket)) Method + (socket-connect (s socket) &rest address) Generic Function + (socket-peername (socket socket)) Method + (socket-name (socket socket)) Method + (socket-receive (socket socket) buffer length &key oob peek waitall (element-type 'character)) Method + (socket-listen (socket socket) backlog) Method + (socket-close (socket socket)) Method + (socket-make-stream (socket socket) &rest args) Method + + (sockopt-reuse-address (socket socket) argument) Accessor + (sockopt-keep-alive (socket socket) argument) Accessor + (sockopt-oob-inline (socket socket) argument) Accessor + (sockopt-bsd-compatible (socket socket) argument) Accessor + (sockopt-pass-credentials (socket socket) argument) Accessor + (sockopt-debug (socket socket) argument) Accessor + (sockopt-dont-route (socket socket) argument) Accessor + (sockopt-broadcast (socket socket) argument) Accessor + (sockopt-tcp-nodelay (socket socket) argument) Accessor + +inet-domain sockets + +class: inet-socket + +slots: + + * family : + +operators: + + (make-inet-address dotted-quads) Function + (get-protocol-by-name name) Function + (make-inet-socket type protocol) Function + +file-domain sockets + +class: unix-socket + +slots: + + * family : + +class: host-ent + +Slots: + + * name : + * aliases : + * address-type : + * addresses : + + (host-ent-address (host-ent host-ent)) Method + (get-host-by-name host-name) Function + (get-host-by-address address) Function + (name-service-error where) Function + (non-blocking-mode (socket socket)) Method + +(define-socket-condition sockint::EADDRINUSE address-in-use-error) +(define-socket-condition sockint::EAGAIN interrupted-error) +(define-socket-condition sockint::EBADF bad-file-descriptor-error) +(define-socket-condition sockint::ECONNREFUSED connection-refused-error) +(define-socket-condition sockint::EINTR interrupted-error) +(define-socket-condition sockint::EINVAL invalid-argument-error) +(define-socket-condition sockint::ENOBUFS no-buffers-error) +(define-socket-condition sockint::ENOMEM out-of-memory-error) +(define-socket-condition sockint::EOPNOTSUPP operation-not-supported-error) +(define-socket-condition sockint::EPERM operation-not-permitted-error) +(define-socket-condition sockint::EPROTONOSUPPORT protocol-not-supported-error) +(define-socket-condition sockint::ESOCKTNOSUPPORT socket-type-not-supported-error) +(define-socket-condition sockint::ENETUNREACH network-unreachable-error) Added: usocket/trunk/doc/usock-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/usock-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,28 @@ +Package: + + clisp : socket + cmucl : extensions + sbcl : sb-bsd-sockets + lw : comm + openmcl: openmcl-socket + allegro: sock + +Connecting (TCP/inet only) + + clisp : socket-connect port &optional [host] &key :element-type :external-format :buffered :timeout = > socket-stream + cmucl : connect-to-inet-socket host port &optional kind => file descriptor + sbcl : sb-socket-connect socket &rest address => socket + lw : open-tcp-stream hostname service &key direction element-type buffered => stream-object + openmcl: socket-connect socket => :active, :passive or nil + allegro: make-socket (&rest args &key type format connect address-family eol) => socket + +Closing + + clisp : close socket + cmucl : close-socket socket + sbcl : socket-close socket + lw : close socket + openmcl: close socket + allegro: close socket + +Errors \ No newline at end of file Added: usocket/trunk/package.lisp ============================================================================== --- (empty file) +++ usocket/trunk/package.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,31 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package :cl-user) + +#+lispworks (require "comm") + +(eval-when (:execute :load-toplevel :compile-toplevel) + (defpackage :usocket + (:use :cl) + (:nicknames :usoc) + (:shadowing-import-from "COMMON-LISP" :close + :open + :read-line + :write-sequence) + (:export :open ; socket related operations + :make-socket + :close + :read-line + :write-sequence + :socket ; socket object and accessors + :host + :port + :get-host-by-address ; name services + :get-host-by-name + :host-byte-order ; utility operators + :usocket-error ; conditions + :no-route-to-host))) + Added: usocket/trunk/test/package.lisp ============================================================================== --- (empty file) +++ usocket/trunk/test/package.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,13 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package :cl-user) + +(eval-when (:execute :load-toplevel :compile-toplevel) + (defpackage :usocket-test + (:use :cl :rt) + (:nicknames :usoct) + (:export :do-tests))) + Added: usocket/trunk/test/test-usocket.lisp ============================================================================== --- (empty file) +++ usocket/trunk/test/test-usocket.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,17 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket-test) + +(defvar *soc1* (usoc:make-socket :socket :stream + :host #(1 2 3 4) + :port 80 + :stream :my-stream)) + +(deftest make-socket.1 (usoc::real-socket usoct::*soc1*) :my-socket) +(deftest make-socket.2 (usoc::real-stream usoct::*soc1*) :my-stream) +(deftest make-socket.3 (usoc:host usoct::*soc1*) #(1 2 3 4)) +(deftest make-socket.4 (usoc:host usoct::*soc1*) 80) + Added: usocket/trunk/test/usocket-test.asd ============================================================================== --- (empty file) +++ usocket/trunk/test/usocket-test.asd Fri Jan 27 17:05:41 2006 @@ -0,0 +1,22 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package #:cl-user) + +(defpackage #:usocket-test-system + (:use #:cl #:asdf)) + +(in-package #:usocket-test-system) + +(defsystem usocket-test + :name "usocket-test" + :author "Erik Enge" + :version "0.1.0" + :licence "MIT" + :description "Tests for usocket" + :depends-on (:usocket :rt) + :components ((:file "package") + (:file "test-usocket" + :depends-on ("package")))) Added: usocket/trunk/usocket.asd ============================================================================== --- (empty file) +++ usocket/trunk/usocket.asd Fri Jan 27 17:05:41 2006 @@ -0,0 +1,39 @@ + +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package #:cl-user) + +(defpackage #:usocket-system + (:use #:cl #:asdf)) + +(in-package #:usocket-system) + +(defsystem usocket + :name "usocket" + :author "Erik Enge" + :version "0.1.0" + :licence "MIT" + :description "Universal socket library for Common Lisp" + :depends-on #+sbcl (:sb-bsd-sockets :split-sequence) + #-sbcl (:split-sequence) + :components ((:file "package") + (:file "usocket" + :depends-on ("package")) + (:file "condition" + :depends-on ("usocket")) + #+clisp (:file "clisp" :pathname "backend/clisp" + :depends-on ("condition")) + #+cmu (:file "cmucl" :pathname "backend/cmucl" + :depends-on ("condition")) + #+sbcl (:file "sbcl" :pathname "backend/sbcl" + :depends-on ("condition")) + #+lispworks (:file "lispworks" :pathname "backend/lispworks" + :depends-on ("condition")) + #+openmcl (:file "openmcl" :pathname "backend/openmcl" + :depends-on ("condition")) + #+allegro (:file "allegro" :pathname "backend/allegro" + :depends-on ("condition")) + )) Added: usocket/trunk/usocket.lisp ============================================================================== --- (empty file) +++ usocket/trunk/usocket.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,79 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defclass socket () + ((real-socket + :initarg :real-socket + :accessor real-socket) + (real-stream + :initarg :real-stream + :accessor real-stream) + (host + :initarg :host + :accessor host) + (port + :initarg :port + :accessor port))) + +(defun make-socket (&key socket host port (stream nil)) + (make-instance 'socket + :real-socket socket + :host host + :port port + :real-stream stream)) + +;; +;; Utility +;; + +(defun list-of-strings-to-integers (list) + "Take a list of strings and return a new list of integers (from +parse-integer) on each of the string elements." + (let ((new-list nil)) + (dolist (element (reverse list)) + (push (parse-integer element) new-list)) + new-list)) + +(defun hbo-to-dotted-quad (integer) + "Host-byte-order integer to dotted-quad string conversion utility." + (let ((first (ldb (byte 8 24) integer)) + (second (ldb (byte 8 16) integer)) + (third (ldb (byte 8 8) integer)) + (fourth (ldb (byte 8 0) integer))) + (format nil "~A.~A.~A.~A" first second third fourth))) + +(defun hbo-to-vector-quad (integer) + "Host-byte-order integer to dotted-quad string conversion utility." + (let ((first (ldb (byte 8 24) integer)) + (second (ldb (byte 8 16) integer)) + (third (ldb (byte 8 8) integer)) + (fourth (ldb (byte 8 0) integer))) + (vector first second third fourth))) + +(defun vector-quad-to-dotted-quad (vector) + (format nil "~A.~A.~A.~A" + (aref vector 0) + (aref vector 1) + (aref vector 2) + (aref vector 3))) + +(defun dotted-quad-to-vector-quad (string) + (let ((list (list-of-strings-to-integers (split-sequence:split-sequence #\. string)))) + (vector (first list) (second list) (third list) (fourth list)))) + +(defmethod host-byte-order ((string string)) + "Convert a string, such as 192.168.1.1, to host-byte-order, such as +3232235777." + (let ((list (list-of-strings-to-integers (split-sequence:split-sequence #\. string)))) + (+ (* (first list) 256 256 256) (* (second list) 256 256) + (* (third list) 256) (fourth list)))) + +(defmethod host-byte-order ((vector vector)) + "Convert a vector, such as #(192 168 1 1), to host-byte-order, such as +3232235777." + (+ (* (aref vector 0) 256 256 256) (* (aref vector 1) 256 256) + (* (aref vector 2) 256) (aref vector 3))) From ehuelsmann at common-lisp.net Fri Jan 27 23:22:30 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 27 Jan 2006 17:22:30 -0600 (CST) Subject: [usocket-cvs] r1 - public_html usocket usocket/branches usocket/tags usocket/trunk usocket/trunk/backend usocket/trunk/doc usocket/trunk/test Message-ID: <20060127232230.7CC851497B@common-lisp.net> Author: ehuelsmann Date: Fri Jan 27 17:05:41 2006 New Revision: 1 Added: public_html/ public_html/index.shtml public_html/project-name public_html/style.css usocket/ usocket/branches/ usocket/tags/ usocket/trunk/ (props changed) usocket/trunk/LICENSE usocket/trunk/Makefile usocket/trunk/README usocket/trunk/backend/ (props changed) usocket/trunk/backend/allegro.lisp usocket/trunk/backend/clisp.lisp usocket/trunk/backend/cmucl.lisp usocket/trunk/backend/lispworks.lisp usocket/trunk/backend/sbcl.lisp usocket/trunk/condition.lisp usocket/trunk/doc/ usocket/trunk/doc/allegro-socket.txt usocket/trunk/doc/clisp-sockets.txt usocket/trunk/doc/cmucl-sockets.txt usocket/trunk/doc/errors.txt usocket/trunk/doc/lw-sockets.txt usocket/trunk/doc/openmcl-sockets.txt usocket/trunk/doc/sb-bsd-sockets.txt usocket/trunk/doc/usock-sockets.txt usocket/trunk/package.lisp usocket/trunk/test/ (props changed) usocket/trunk/test/package.lisp usocket/trunk/test/test-usocket.lisp usocket/trunk/test/usocket-test.asd usocket/trunk/usocket.asd usocket/trunk/usocket.lisp Log: Initial import as copied off Erik Enge's home dir. Added: public_html/index.shtml ============================================================================== --- (empty file) +++ public_html/index.shtml Fri Jan 27 17:05:41 2006 @@ -0,0 +1,25 @@ + + + + + <!--#include virtual="project-name" --> + + + + + +
+

+
+ +

This is an automatically generated placeholder page: this project + has not yet created a website.

+ +

Back to Common-lisp.net.

+ +
+ Valid XHTML 1.0 Strict +
+ + Added: public_html/project-name ============================================================================== --- (empty file) +++ public_html/project-name Fri Jan 27 17:05:41 2006 @@ -0,0 +1 @@ +usocket Added: public_html/style.css ============================================================================== --- (empty file) +++ public_html/style.css Fri Jan 27 17:05:41 2006 @@ -0,0 +1,54 @@ + +.header { + font-size: medium; + background-color:#336699; + color:#ffffff; + border-style:solid; + border-width: 5px; + border-color:#002244; + padding: 1mm 1mm 1mm 5mm; +} + +.footer { + font-size: small; + font-style: italic; + text-align: right; + background-color:#336699; + color:#ffffff; + border-style:solid; + border-width: 2px; + border-color:#002244; + padding: 1mm 1mm 1mm 1mm; +} + +.footer a:link { + font-weight:bold; + color:#ffffff; + text-decoration:underline; +} + +.footer a:visited { + font-weight:bold; + color:#ffffff; + text-decoration:underline; +} + +.footer a:hover { + font-weight:bold; + color:#002244; + text-decoration:underline; } + +.check {font-size: x-small; + text-align:right;} + +.check a:link { font-weight:bold; + color:#a0a0ff; + text-decoration:underline; } + +.check a:visited { font-weight:bold; + color:#a0a0ff; + text-decoration:underline; } + +.check a:hover { font-weight:bold; + color:#000000; + text-decoration:underline; } Added: usocket/trunk/LICENSE ============================================================================== --- (empty file) +++ usocket/trunk/LICENSE Fri Jan 27 17:05:41 2006 @@ -0,0 +1,23 @@ +(This is the MIT / X Consortium license as taken from + http://www.opensource.org/licenses/mit-license.html) + +Copyright (c) 2003 Erik Enge + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Added: usocket/trunk/Makefile ============================================================================== --- (empty file) +++ usocket/trunk/Makefile Fri Jan 27 17:05:41 2006 @@ -0,0 +1,9 @@ +# $Id$ +# $Source$ + +clean: + find -name -o -name "*~" -o -name "*.err" -o -name "*.x86f" -o -name "*.lib" -o -name "*.fas" -o -name "*.fasl" -o -name "*.faslmt" -o -name "*.ufsl" | xargs rm + +commit: + make clean; cvs up; cvs ci + Added: usocket/trunk/README ============================================================================== --- (empty file) +++ usocket/trunk/README Fri Jan 27 17:05:41 2006 @@ -0,0 +1,17 @@ + +;; the backends must implement +;; +;; - handle-condition +;; - open +;; - close +;; - listen +;; - accept +;; - read-line +;; - write-sequence +;; - get-host-by-address +;; - get-host-by-name +;; +;; the backend must wrap all calls to its socket functions in a +;; handler-case/bind to make sure handle-condition is called. + +;; open should take either the hostname or an vectorized ip \ No newline at end of file Added: usocket/trunk/backend/allegro.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/allegro.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,34 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (sock:make-socket :remote-host host + :remote-port port))) + +(defmethod close ((socket socket)) + "Close socket." + (sock:close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (sock:lookup-host address)) + +(defun get-host-by-name (name) + (sock:lookup-host name)) Added: usocket/trunk/backend/clisp.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/clisp.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,40 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (socket:socket-connect port host) + :host host + :port port)) + +(defmethod close ((socket socket)) + "Close socket." + (socket:socket-server-close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (handler-case (posix:hostent-name + (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (mapcar #'dotted-quad-to-vector-quad + (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/backend/cmucl.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/cmucl.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,41 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (let* ((socket (ext:connect-to-inet-socket (host-byte-order host) port type)) + (stream (sys:make-fd-stream socket :input t :output t :element-type 'character)) + (usocket (make-socket :socket socket :host host :port port :stream stream))) + usocket)) + +(defmethod close ((socket socket)) + "Close socket." + (ext:close-socket (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-stream socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-stream socket))) + +(defun get-host-by-address (address) + (handler-case (ext:host-entry-name + (ext::lookup-host-entry (host-byte-order address))) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (mapcar #'hbo-to-vector-quad + (ext:host-entry-addr-list + (ext:lookup-host-entry name))) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/backend/lispworks.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/lispworks.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,37 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + (declare (ignore type)) + (make-socket :socket (comm:open-tcp-stream host port) + :host host + :port port)) + +(defmethod close ((socket socket)) + "Close socket." + (cl:close (real-socket socket))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-socket socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-socket socket))) + +(defun get-host-by-address (address) + (comm:get-host-entry (vector-quad-to-dotted-quad address) + :fields '(:name))) + +(defun get-host-by-name (name) + (mapcar #'hbo-to-vector-quad + (comm:get-host-entry name :fields '(:addresses)))) Added: usocket/trunk/backend/sbcl.lisp ============================================================================== --- (empty file) +++ usocket/trunk/backend/sbcl.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,48 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defun handle-condition (condition &optional (socket nil)) + "Dispatch correct usocket condition." + (typecase condition + (condition (error 'usocket-error + :real-condition condition + :socket socket)))) + +(defun open (host port &optional (type :stream)) + "Connect to `host' on `port'. `host' is assumed to be a string of +an IP address represented in vector notation, such as #(192 168 1 1). +`port' is assumed to be an integer. + +Returns a socket object." + (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket :type type :protocol :tcp)) + (stream (sb-bsd-sockets:socket-make-stream socket)) + (usocket (make-socket :socket socket :host host :port port :stream stream))) + (handler-case (sb-bsd-sockets:socket-connect socket host port) + (condition (condition) (handle-condition condition usocket))) + usocket)) + +(defmethod close ((socket socket)) + "Close socket." + (handler-case (sb-bsd-sockets:socket-close (real-socket socket)) + (condition (condition) (handle-condition condition socket)))) + +(defmethod read-line ((socket socket)) + (cl:read-line (real-stream socket))) + +(defmethod write-sequence ((socket socket) sequence) + (cl:write-sequence sequence (real-stream socket))) + +(defun get-host-by-address (address) + (handler-case (sb-bsd-sockets::host-ent-name + (sb-bsd-sockets:get-host-by-address address)) + (condition (condition) (handle-condition condition)))) + +(defun get-host-by-name (name) + (handler-case (sb-bsd-sockets::host-ent-addresses + (sb-bsd-sockets:get-host-by-name name)) + (condition (condition) (handle-condition condition)))) + Added: usocket/trunk/condition.lisp ============================================================================== --- (empty file) +++ usocket/trunk/condition.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,18 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(define-condition usocket-error (error) + ((real-condition + :reader real-condition + :initarg :real-condition) + (socket + :reader socket + :initarg :socket)) + (:report (lambda (c stream) + (format stream "Error (~A) occured in socket: ~A." + (real-condition c) (socket c))))) + Added: usocket/trunk/doc/allegro-socket.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/allegro-socket.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,46 @@ + + +(require :sock) + +accept-connection (sock passive-socket) &key wait Generic function. +dotted-to-ipaddr dotted &key errorp Function. +ipaddr-to-dotted ipaddr &key values Function. +ipaddr-to-hostname ipaddr Function. +lookup-hostname hostname +lookup-port portname protocol Function. +make-socket &key type format address-family connect &allow-other-keys Function. +with-pending-connect &body body Macro. +receive-from (sock datagram-socket) size &key buffer extract Generic function. +send-to sock &key +shutdown sock &key direction +socket-control stream &key output-chunking output-chunking-eof input-chunking +socket-os-fd sock Generic function. + +remote-host socket Generic function. +local-host socket Generic function. +local-port socket + +remote-filename socket +local-filename socket +remote-port socket +socket-address-family socket +socket-connect socket +socket-format socket +socket-type socket + +errors + +:address-in-use Local socket address already in use +:address-not-available Local socket address not available +:network-down Network is down +:network-reset Network has been reset +:connection-aborted Connection aborted +:connection-reset Connection reset by peer +:no-buffer-space No buffer space +:shutdown Connection shut down +:connection-timed-out Connection timed out +:connection-refused Connection refused +:host-down Host is down +:host-unreachable Host is unreachable +:unknown Unknown error + Added: usocket/trunk/doc/clisp-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/clisp-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,16 @@ +http://clisp.cons.org/impnotes.html#socket + +(SOCKET:SOCKET-SERVER &OPTIONAL [port-or-socket]) +(SOCKET:SOCKET-SERVER-HOST socket-server) +(SOCKET:SOCKET-SERVER-PORT socket-server) +(SOCKET:SOCKET-WAIT socket-server &OPTIONAL [seconds [microseconds]]) +(SOCKET:SOCKET-ACCEPT socket-server &KEY :ELEMENT-TYPE :EXTERNAL-FORMAT :BUFFERED :TIMEOUT) +(SOCKET:SOCKET-CONNECT port &OPTIONAL [host] &KEY :ELEMENT-TYPE :EXTERNAL-FORMAT :BUFFERED :TIMEOUT) +(SOCKET:SOCKET-STATUS socket-stream-or-list &OPTIONAL [seconds [microseconds]]) +(SOCKET:SOCKET-STREAM-HOST socket-stream) +(SOCKET:SOCKET-STREAM-PORT socket-stream) +(SOCKET:SOCKET-SERVICE-PORT &OPTIONAL service-name (protocol "tcp")) +(SOCKET:SOCKET-STREAM-PEER socket-stream [do-not-resolve-p]) +(SOCKET:SOCKET-STREAM-LOCAL socket-stream [do-not-resolve-p]) +(SOCKET:SOCKET-STREAM-SHUTDOWN socket-stream direction) +(SOCKET:SOCKET-OPTIONS socket-server &REST {option}*) Added: usocket/trunk/doc/cmucl-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/cmucl-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,56 @@ +http://cvs2.cons.org/ftp-area/cmucl/doc/cmu-user/internet.html + +extensions:lookup-host-entry host + +[structure] +host-entry + + name aliases addr-type addr-list + +[Function] +extensions:ip-string addr + +[Function] +extensions:create-inet-listener port &optional kind &key :reuse-address :backlog :interface + +[Function] +extensions:create-unix-listener path &optional kind :reuse-address :backlog + +[Function] +extensions:accept-tcp-connection unconnected + +[Function] +extensions:accept-unix-connection unconnected + +[Function] +extensions:connect-to-inet-socket host port &optional kind + +[Function] +extensions:connect-to-unix-socket path &optional kind + +[Function] +extensions:add-oob-handler fd char handler + +[Function] +extensions:remove-oob-handler fd char + +[Function] +extensions:remove-all-oob-handlers fd + +[Function] +extensions:send-character-out-of-band fd char + +[Function] +extensions:create-unix-socket &optional type + +[Function] +extensions:create-inet-socket &optional type + +[Function] +extensions:get-socket-option socket level optname + +[Function] +extensions:set-socket-option socket level optname optval + +[Function] +extensions:close-socket socket Added: usocket/trunk/doc/errors.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/errors.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,13 @@ +EADDRINUSE address-in-use-error +EAGAIN interrupted-error +EBADF bad-file-descriptor-error +ECONNREFUSED connection-refused-error +EINTR interrupted-error +EINVAL invalid-argument-error +ENOBUFS no-buffers-error +ENOMEM out-of-memory-error +EOPNOTSUPP operation-not-supported-error +EPERM operation-not-permitted-error +EPROTONOSUPPORT protocol-not-supported-error +ESOCKTNOSUPPORT socket-type-not-supported-error +ENETUNREACH network-unreachable-error Added: usocket/trunk/doc/lw-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/lw-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,16 @@ +http://www.lispworks.com/reference/lwu41/lwref/LWRM_37.HTM + +Package: COMM + +get-host-entry +get-socket-address +get-socket-peer-address +ip-address-string +open-tcp-stream +socket-stream-address +socket-stream-peer-address +start-up-server +start-up-server-and-mp +socket-stream +string-ip-address +with-noticed-socket-stream Added: usocket/trunk/doc/openmcl-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/openmcl-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,27 @@ +http://openmcl.clozure.com/Doc/sockets.html + + make-socket [Function] + accept-connection [Function] + dotted-to-ipaddr [Function] + ipaddr-to-dotted [Function] + ipaddr-to-hostname [Function] + lookup-hostname [Function] + lookup-port [Function] + receive-from [Function] + send-to [Function] + shutdown [Function] + socket-os-fd [Function] + remote-port [Function] + local-host [Function] + local-port [Function] + + socket-address-family [Function] + + socket-connect [Function] + socket-format [Function] + socket-type [Function] + socket-error [Class] + socket-error-code [Function] + socket-error-identifier [Function] + socket-error-situation [Function] + close [method] Added: usocket/trunk/doc/sb-bsd-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/sb-bsd-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,86 @@ +http://www.xach.com/sbcl/sb-bsd-sockets.html + +package: sb-bsd-sockets + +class: socket + +slots: + + * file-descriptor : + * family : + * protocol : + * type : + * stream : + +operators: + + (socket-bind (s socket) &rest address) Generic Function + (socket-accept (socket socket)) Method + (socket-connect (s socket) &rest address) Generic Function + (socket-peername (socket socket)) Method + (socket-name (socket socket)) Method + (socket-receive (socket socket) buffer length &key oob peek waitall (element-type 'character)) Method + (socket-listen (socket socket) backlog) Method + (socket-close (socket socket)) Method + (socket-make-stream (socket socket) &rest args) Method + + (sockopt-reuse-address (socket socket) argument) Accessor + (sockopt-keep-alive (socket socket) argument) Accessor + (sockopt-oob-inline (socket socket) argument) Accessor + (sockopt-bsd-compatible (socket socket) argument) Accessor + (sockopt-pass-credentials (socket socket) argument) Accessor + (sockopt-debug (socket socket) argument) Accessor + (sockopt-dont-route (socket socket) argument) Accessor + (sockopt-broadcast (socket socket) argument) Accessor + (sockopt-tcp-nodelay (socket socket) argument) Accessor + +inet-domain sockets + +class: inet-socket + +slots: + + * family : + +operators: + + (make-inet-address dotted-quads) Function + (get-protocol-by-name name) Function + (make-inet-socket type protocol) Function + +file-domain sockets + +class: unix-socket + +slots: + + * family : + +class: host-ent + +Slots: + + * name : + * aliases : + * address-type : + * addresses : + + (host-ent-address (host-ent host-ent)) Method + (get-host-by-name host-name) Function + (get-host-by-address address) Function + (name-service-error where) Function + (non-blocking-mode (socket socket)) Method + +(define-socket-condition sockint::EADDRINUSE address-in-use-error) +(define-socket-condition sockint::EAGAIN interrupted-error) +(define-socket-condition sockint::EBADF bad-file-descriptor-error) +(define-socket-condition sockint::ECONNREFUSED connection-refused-error) +(define-socket-condition sockint::EINTR interrupted-error) +(define-socket-condition sockint::EINVAL invalid-argument-error) +(define-socket-condition sockint::ENOBUFS no-buffers-error) +(define-socket-condition sockint::ENOMEM out-of-memory-error) +(define-socket-condition sockint::EOPNOTSUPP operation-not-supported-error) +(define-socket-condition sockint::EPERM operation-not-permitted-error) +(define-socket-condition sockint::EPROTONOSUPPORT protocol-not-supported-error) +(define-socket-condition sockint::ESOCKTNOSUPPORT socket-type-not-supported-error) +(define-socket-condition sockint::ENETUNREACH network-unreachable-error) Added: usocket/trunk/doc/usock-sockets.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/usock-sockets.txt Fri Jan 27 17:05:41 2006 @@ -0,0 +1,28 @@ +Package: + + clisp : socket + cmucl : extensions + sbcl : sb-bsd-sockets + lw : comm + openmcl: openmcl-socket + allegro: sock + +Connecting (TCP/inet only) + + clisp : socket-connect port &optional [host] &key :element-type :external-format :buffered :timeout = > socket-stream + cmucl : connect-to-inet-socket host port &optional kind => file descriptor + sbcl : sb-socket-connect socket &rest address => socket + lw : open-tcp-stream hostname service &key direction element-type buffered => stream-object + openmcl: socket-connect socket => :active, :passive or nil + allegro: make-socket (&rest args &key type format connect address-family eol) => socket + +Closing + + clisp : close socket + cmucl : close-socket socket + sbcl : socket-close socket + lw : close socket + openmcl: close socket + allegro: close socket + +Errors \ No newline at end of file Added: usocket/trunk/package.lisp ============================================================================== --- (empty file) +++ usocket/trunk/package.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,31 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package :cl-user) + +#+lispworks (require "comm") + +(eval-when (:execute :load-toplevel :compile-toplevel) + (defpackage :usocket + (:use :cl) + (:nicknames :usoc) + (:shadowing-import-from "COMMON-LISP" :close + :open + :read-line + :write-sequence) + (:export :open ; socket related operations + :make-socket + :close + :read-line + :write-sequence + :socket ; socket object and accessors + :host + :port + :get-host-by-address ; name services + :get-host-by-name + :host-byte-order ; utility operators + :usocket-error ; conditions + :no-route-to-host))) + Added: usocket/trunk/test/package.lisp ============================================================================== --- (empty file) +++ usocket/trunk/test/package.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,13 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package :cl-user) + +(eval-when (:execute :load-toplevel :compile-toplevel) + (defpackage :usocket-test + (:use :cl :rt) + (:nicknames :usoct) + (:export :do-tests))) + Added: usocket/trunk/test/test-usocket.lisp ============================================================================== --- (empty file) +++ usocket/trunk/test/test-usocket.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,17 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket-test) + +(defvar *soc1* (usoc:make-socket :socket :stream + :host #(1 2 3 4) + :port 80 + :stream :my-stream)) + +(deftest make-socket.1 (usoc::real-socket usoct::*soc1*) :my-socket) +(deftest make-socket.2 (usoc::real-stream usoct::*soc1*) :my-stream) +(deftest make-socket.3 (usoc:host usoct::*soc1*) #(1 2 3 4)) +(deftest make-socket.4 (usoc:host usoct::*soc1*) 80) + Added: usocket/trunk/test/usocket-test.asd ============================================================================== --- (empty file) +++ usocket/trunk/test/usocket-test.asd Fri Jan 27 17:05:41 2006 @@ -0,0 +1,22 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package #:cl-user) + +(defpackage #:usocket-test-system + (:use #:cl #:asdf)) + +(in-package #:usocket-test-system) + +(defsystem usocket-test + :name "usocket-test" + :author "Erik Enge" + :version "0.1.0" + :licence "MIT" + :description "Tests for usocket" + :depends-on (:usocket :rt) + :components ((:file "package") + (:file "test-usocket" + :depends-on ("package")))) Added: usocket/trunk/usocket.asd ============================================================================== --- (empty file) +++ usocket/trunk/usocket.asd Fri Jan 27 17:05:41 2006 @@ -0,0 +1,39 @@ + +;;;; $Id$ +;;;; $Source$ + +;;;; See the LICENSE file for licensing information. + +(in-package #:cl-user) + +(defpackage #:usocket-system + (:use #:cl #:asdf)) + +(in-package #:usocket-system) + +(defsystem usocket + :name "usocket" + :author "Erik Enge" + :version "0.1.0" + :licence "MIT" + :description "Universal socket library for Common Lisp" + :depends-on #+sbcl (:sb-bsd-sockets :split-sequence) + #-sbcl (:split-sequence) + :components ((:file "package") + (:file "usocket" + :depends-on ("package")) + (:file "condition" + :depends-on ("usocket")) + #+clisp (:file "clisp" :pathname "backend/clisp" + :depends-on ("condition")) + #+cmu (:file "cmucl" :pathname "backend/cmucl" + :depends-on ("condition")) + #+sbcl (:file "sbcl" :pathname "backend/sbcl" + :depends-on ("condition")) + #+lispworks (:file "lispworks" :pathname "backend/lispworks" + :depends-on ("condition")) + #+openmcl (:file "openmcl" :pathname "backend/openmcl" + :depends-on ("condition")) + #+allegro (:file "allegro" :pathname "backend/allegro" + :depends-on ("condition")) + )) Added: usocket/trunk/usocket.lisp ============================================================================== --- (empty file) +++ usocket/trunk/usocket.lisp Fri Jan 27 17:05:41 2006 @@ -0,0 +1,79 @@ +;;;; $Id$ +;;;; $Source$ + +;;;; See LICENSE for licensing information. + +(in-package :usocket) + +(defclass socket () + ((real-socket + :initarg :real-socket + :accessor real-socket) + (real-stream + :initarg :real-stream + :accessor real-stream) + (host + :initarg :host + :accessor host) + (port + :initarg :port + :accessor port))) + +(defun make-socket (&key socket host port (stream nil)) + (make-instance 'socket + :real-socket socket + :host host + :port port + :real-stream stream)) + +;; +;; Utility +;; + +(defun list-of-strings-to-integers (list) + "Take a list of strings and return a new list of integers (from +parse-integer) on each of the string elements." + (let ((new-list nil)) + (dolist (element (reverse list)) + (push (parse-integer element) new-list)) + new-list)) + +(defun hbo-to-dotted-quad (integer) + "Host-byte-order integer to dotted-quad string conversion utility." + (let ((first (ldb (byte 8 24) integer)) + (second (ldb (byte 8 16) integer)) + (third (ldb (byte 8 8) integer)) + (fourth (ldb (byte 8 0) integer))) + (format nil "~A.~A.~A.~A" first second third fourth))) + +(defun hbo-to-vector-quad (integer) + "Host-byte-order integer to dotted-quad string conversion utility." + (let ((first (ldb (byte 8 24) integer)) + (second (ldb (byte 8 16) integer)) + (third (ldb (byte 8 8) integer)) + (fourth (ldb (byte 8 0) integer))) + (vector first second third fourth))) + +(defun vector-quad-to-dotted-quad (vector) + (format nil "~A.~A.~A.~A" + (aref vector 0) + (aref vector 1) + (aref vector 2) + (aref vector 3))) + +(defun dotted-quad-to-vector-quad (string) + (let ((list (list-of-strings-to-integers (split-sequence:split-sequence #\. string)))) + (vector (first list) (second list) (third list) (fourth list)))) + +(defmethod host-byte-order ((string string)) + "Convert a string, such as 192.168.1.1, to host-byte-order, such as +3232235777." + (let ((list (list-of-strings-to-integers (split-sequence:split-sequence #\. string)))) + (+ (* (first list) 256 256 256) (* (second list) 256 256) + (* (third list) 256) (fourth list)))) + +(defmethod host-byte-order ((vector vector)) + "Convert a vector, such as #(192 168 1 1), to host-byte-order, such as +3232235777." + (+ (* (aref vector 0) 256 256 256) (* (aref vector 1) 256 256) + (* (aref vector 2) 256) (aref vector 3))) From ehuelsmann at common-lisp.net Sat Jan 28 19:58:33 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 13:58:33 -0600 (CST) Subject: [usocket-cvs] r2 - public_html usocket/trunk/doc Message-ID: <20060128195833.ED8452A01A@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 13:56:16 2006 New Revision: 2 Added: usocket/trunk/doc/design.txt Modified: public_html/index.shtml Log: Update documentation. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 13:56:16 2006 @@ -13,8 +13,9 @@

-

This is an automatically generated placeholder page: this project - has not yet created a website.

+

This project has recently started. See the design +document for more information.

Back to Common-lisp.net.

Added: usocket/trunk/doc/design.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/design.txt Sat Jan 28 13:56:16 2006 @@ -0,0 +1,25 @@ + + -*- text -*- + + usocket: Universal sockets library + ================================== + +Contents +======== + + + +Design goal +=========== + +To provide a portable socket interface for as many implementations as +possible, while keeping the portability layer as thin as possible. + +Minimally, I'd like to support: + - SBCL + - CMUCL + - Allegro + - LispWorks + - ArmedBear (ABCL) + + From ehuelsmann at common-lisp.net Sat Jan 28 20:00:08 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 14:00:08 -0600 (CST) Subject: [usocket-cvs] r2 - public_html usocket/trunk/doc Message-ID: <20060128200008.E28742A01A@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 13:56:16 2006 New Revision: 2 Added: usocket/trunk/doc/design.txt Modified: public_html/index.shtml Log: Update documentation. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 13:56:16 2006 @@ -13,8 +13,9 @@

-

This is an automatically generated placeholder page: this project - has not yet created a website.

+

This project has recently started. See the design +document for more information.

Back to Common-lisp.net.

Added: usocket/trunk/doc/design.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/design.txt Sat Jan 28 13:56:16 2006 @@ -0,0 +1,25 @@ + + -*- text -*- + + usocket: Universal sockets library + ================================== + +Contents +======== + + + +Design goal +=========== + +To provide a portable socket interface for as many implementations as +possible, while keeping the portability layer as thin as possible. + +Minimally, I'd like to support: + - SBCL + - CMUCL + - Allegro + - LispWorks + - ArmedBear (ABCL) + + From ehuelsmann at common-lisp.net Sat Jan 28 20:04:48 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 14:04:48 -0600 (CST) Subject: [usocket-cvs] r2 - public_html usocket/trunk/doc Message-ID: <20060128200448.C13C1E008@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 13:56:16 2006 New Revision: 2 Added: usocket/trunk/doc/design.txt Modified: public_html/index.shtml Log: Update documentation. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 13:56:16 2006 @@ -13,8 +13,9 @@

-

This is an automatically generated placeholder page: this project - has not yet created a website.

+

This project has recently started. See the design +document for more information.

Back to Common-lisp.net.

Added: usocket/trunk/doc/design.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/design.txt Sat Jan 28 13:56:16 2006 @@ -0,0 +1,25 @@ + + -*- text -*- + + usocket: Universal sockets library + ================================== + +Contents +======== + + + +Design goal +=========== + +To provide a portable socket interface for as many implementations as +possible, while keeping the portability layer as thin as possible. + +Minimally, I'd like to support: + - SBCL + - CMUCL + - Allegro + - LispWorks + - ArmedBear (ABCL) + + From ehuelsmann at common-lisp.net Sat Jan 28 20:07:37 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 14:07:37 -0600 (CST) Subject: [usocket-cvs] r2 - public_html usocket/trunk/doc Message-ID: <20060128200737.4B7AD11637@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 13:56:16 2006 New Revision: 2 Added: usocket/trunk/doc/design.txt Modified: public_html/index.shtml Log: Update documentation. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 13:56:16 2006 @@ -13,8 +13,9 @@

-

This is an automatically generated placeholder page: this project - has not yet created a website.

+

This project has recently started. See the design +document for more information.

Back to Common-lisp.net.

Added: usocket/trunk/doc/design.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/design.txt Sat Jan 28 13:56:16 2006 @@ -0,0 +1,25 @@ + + -*- text -*- + + usocket: Universal sockets library + ================================== + +Contents +======== + + + +Design goal +=========== + +To provide a portable socket interface for as many implementations as +possible, while keeping the portability layer as thin as possible. + +Minimally, I'd like to support: + - SBCL + - CMUCL + - Allegro + - LispWorks + - ArmedBear (ABCL) + + From ehuelsmann at common-lisp.net Sat Jan 28 20:08:05 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 14:08:05 -0600 (CST) Subject: [usocket-cvs] r2 - public_html usocket/trunk/doc Message-ID: <20060128200805.48A5814973@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 13:56:16 2006 New Revision: 2 Added: usocket/trunk/doc/design.txt Modified: public_html/index.shtml Log: Update documentation. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 13:56:16 2006 @@ -13,8 +13,9 @@

-

This is an automatically generated placeholder page: this project - has not yet created a website.

+

This project has recently started. See the design +document for more information.

Back to Common-lisp.net.

Added: usocket/trunk/doc/design.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/design.txt Sat Jan 28 13:56:16 2006 @@ -0,0 +1,25 @@ + + -*- text -*- + + usocket: Universal sockets library + ================================== + +Contents +======== + + + +Design goal +=========== + +To provide a portable socket interface for as many implementations as +possible, while keeping the portability layer as thin as possible. + +Minimally, I'd like to support: + - SBCL + - CMUCL + - Allegro + - LispWorks + - ArmedBear (ABCL) + + From ehuelsmann at common-lisp.net Sat Jan 28 20:11:03 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 14:11:03 -0600 (CST) Subject: [usocket-cvs] r3 - public_html Message-ID: <20060128201103.4521E1F02F@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 14:11:02 2006 New Revision: 3 Modified: public_html/index.shtml Log: Correct link to the design document. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jan 28 14:11:02 2006 @@ -14,7 +14,7 @@

This project has recently started. See the design +href="http://common-lisp.net/websvn/filedetails.php?repname=usocket&path=%2Fusocket%2Ftrunk%2Fdoc%2Fdesign.txt&rev=0&sc=0">the design document for more information.

Back to Common-lisp.net.

From ehuelsmann at common-lisp.net Sat Jan 28 22:52:58 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jan 2006 16:52:58 -0600 (CST) Subject: [usocket-cvs] r4 - usocket/trunk/doc Message-ID: <20060128225258.6731F2A01A@common-lisp.net> Author: ehuelsmann Date: Sat Jan 28 16:52:58 2006 New Revision: 4 Modified: usocket/trunk/doc/design.txt (contents, props changed) Log: Update design document. Modified: usocket/trunk/doc/design.txt ============================================================================== --- usocket/trunk/doc/design.txt (original) +++ usocket/trunk/doc/design.txt Sat Jan 28 16:52:58 2006 @@ -1,19 +1,72 @@ -*- text -*- +$Id$ + + usocket: Universal sockets library ================================== Contents ======== + * Motivation + * Design goal + * Functional requirements + + + + +Motivation +========== + +There are 2 other portability sockets packages [that I know of] +out there: + 1) trivial-sockets + 2) acl-compat (which is a *lot* broader, but contains sockets too) +The first misses some functionality which is fundamental when +the requirements stop being 'trivial', such as finding out the +addresses of either side connected to the tcp/ip stream. + +The second, being a complete compatibility library for Allegro, +contains much more than only sockets. Next to that, as the docs +say, is it mainly directed at providing the functionality required +to port portable-allegroserve - meaning it may be (very) incomplete +on some platforms. + +So, that's why I decided to inherit Erik Enge's project to build +a library with the intention to provide portability code in only +1 area of programming, targeted at 'not so trivial' programming. + +Also, I need this library to extend cl-irc with full DCC functionality. + + Design goal =========== -To provide a portable socket interface for as many implementations as -possible, while keeping the portability layer as thin as possible. +To provide a portable TCP/IP socket interface for as many +implementations as possible, while keeping the portability layer +as thin as possible. + + + +Functional requirements +======================= + +The interface provided should allow: + - 'client'/active sockets + - 'server'/listening sockets + - retrieve IP addresses/ports for both sides of the connection + - provide the usual stream methods to operate on the connection stream + (not necessarily the socket itself; maybe a socket slot too) + +Several relevant support functionalities will have to be provided too: + - long <-> quad-vector operators + - quad-vector <-> string operators + - hostname <-> quad-vector operators (hostname resolution) + Minimally, I'd like to support: - SBCL From ehuelsmann at common-lisp.net Sun Jan 29 19:23:39 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 29 Jan 2006 13:23:39 -0600 (CST) Subject: [usocket-cvs] r6 - public_html usocket/trunk/doc Message-ID: <20060129192339.50083D07F@common-lisp.net> Author: ehuelsmann Date: Sun Jan 29 13:23:36 2006 New Revision: 6 Modified: public_html/index.shtml public_html/style.css usocket/trunk/doc/design.txt Log: Update website and sync design document. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sun Jan 29 13:23:36 2006 @@ -13,13 +13,110 @@

+

Community

+

This project has recently started. See the design document for more information.

-

Back to Common-lisp.net.

+

Development discussion takes place on + usocket-devel at common-lisp.net. + Please feel free to join and chip in! (This currently being a single man project, please announce yourself.) +

+ +
+

Development roadmap

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Roadmap
Major stepsImplementations
Minor stepsSBCLCMUCLABCLclispAllegroLispWorks
Minimal active sockets support + at the same level as provided by + trivial-sockets.
+ (Meaning streamed tcp traffic on connected sockets.)
Investigate interfaces provided.TODOTODOTODOTODOTODOTODO
Implement active socket support.TODOTODOTODOTODOTODOTODO
Add functions to retrieve socket properties.
+ Such as local and remote IP address and port.
Investigate interfaces providedTODOTODOTODOTODOTODOTODO
Implement it.TODOTODOTODOTODOTODOTODO
Add support for passive (connection-accepting/server) + sockets.Investigate interfaces providedTODOTODOTODOTODOTODOTODO
Implement passive socket support.TODOTODOTODOTODOTODOTODO
+
+ +
-
+
+Back to Common-lisp.net. +
+
Valid XHTML 1.0 Strict
Modified: public_html/style.css ============================================================================== --- public_html/style.css (original) +++ public_html/style.css Sun Jan 29 13:23:36 2006 @@ -52,3 +52,16 @@ .check a:hover { font-weight:bold; color:#000000; text-decoration:underline; } + +.roadmap-table { border-style: solid; + border-width: 2px; + border-color: #000; } + +.roadmap-head { border-style: solid; + border-width: 2px; + border-color: #000; } + +.TODO { background-color: #b00; + color: #fff; + font-weight: bold; + text-align: center; } Modified: usocket/trunk/doc/design.txt ============================================================================== --- usocket/trunk/doc/design.txt (original) +++ usocket/trunk/doc/design.txt Sun Jan 29 13:23:36 2006 @@ -72,8 +72,9 @@ Minimally, I'd like to support: - SBCL - CMUCL + - ABCL (ArmedBear) + - clisp - Allegro - LispWorks - - ArmedBear (ABCL) From ehuelsmann at common-lisp.net Sun Jan 29 20:51:42 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 29 Jan 2006 14:51:42 -0600 (CST) Subject: [usocket-cvs] r7 - public_html Message-ID: <20060129205142.84C3A2E043@common-lisp.net> Author: ehuelsmann Date: Sun Jan 29 14:51:41 2006 New Revision: 7 Modified: public_html/index.shtml Log: Update roadmap table. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sun Jan 29 14:51:41 2006 @@ -31,17 +31,19 @@ Roadmap - Major stepsImplementations + Major steps + Socket implementations Minor steps - SBCL - CMUCL + SBCL + CMUCL ABCL - clisp - Allegro - LispWorks + clisp + Allegro + LispWorks + OpenMCL @@ -57,6 +59,7 @@ TODO TODO TODO + TODO Implement active socket support. @@ -66,6 +69,7 @@ TODO TODO TODO + TODO Add functions to retrieve socket properties.
@@ -77,6 +81,7 @@ TODO TODO TODO + TODO Implement it. @@ -86,6 +91,7 @@ TODO TODO TODO + TODO Add support for passive (connection-accepting/server) @@ -97,6 +103,7 @@ TODO TODO TODO + TODO Implement passive socket support. @@ -106,6 +113,7 @@ TODO TODO TODO + TODO From ehuelsmann at common-lisp.net Sun Jan 29 21:51:25 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 29 Jan 2006 15:51:25 -0600 (CST) Subject: [usocket-cvs] r8 - in usocket/trunk: . backend doc Message-ID: <20060129215125.8F7DA1B899@common-lisp.net> Author: ehuelsmann Date: Sun Jan 29 15:51:23 2006 New Revision: 8 Added: usocket/trunk/doc/active-sockets-apis.txt Modified: usocket/trunk/backend/sbcl.lisp usocket/trunk/doc/design.txt usocket/trunk/package.lisp usocket/trunk/usocket.asd usocket/trunk/usocket.lisp (contents, props changed) Log: Implement the first bit of 'Step 1' in SBCL and at the same time, start documenting the different implementations wrt that same step. Modified: usocket/trunk/backend/sbcl.lisp ============================================================================== --- usocket/trunk/backend/sbcl.lisp (original) +++ usocket/trunk/backend/sbcl.lisp Sun Jan 29 15:51:23 2006 @@ -12,48 +12,33 @@ :real-condition condition :socket socket)))) -(defun socket-create (&optional (type :stream)) +(defun socket-connect (host port &optional (type :stream)) "Connect to `host' on `port'. `host' is assumed to be a string of an IP address represented in vector notation, such as #(192 168 1 1). `port' is assumed to be an integer. -Returns a socket object." +Returns a usocket object." (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket :type type :protocol :tcp)) - (stream (sb-bsd-sockets:socket-make-stream socket))) - (make-instance 'usocket :stream stream :socket socket))) - -(defmethod socket-bind ((usocket usocket) - &key (local-host "localhost") - (local-port 0) - (reuse-address t)) - (with-slots (usocket) - socket -;; (setf (sockopt-reuseaddress socket) reuse-address) - (setf socket - -(defmethod socket-connect (host port) + (stream (sb-bsd-sockets:socket-make-stream socket)) + (usocket (make-instance 'usocket :stream stream :socket socket))) (handler-case (sb-bsd-sockets:socket-connect socket host port) (condition (condition) (handle-condition condition usocket))) usocket)) -(defmethod socket-close ((socket socket)) +(defmethod socket-close ((usocket usocket)) "Close socket." - (handler-case (sb-bsd-sockets:socket-close (real-socket socket)) - (condition (condition) (handle-condition condition socket)))) + (handler-case (sb-bsd-sockets:socket-close (socket usocket)) + (condition (condition) (handle-condition condition usocket)))) -(defmethod socket-read-line ((socket socket)) - (cl:read-line (real-stream socket))) -(defmethod socket-write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-stream socket))) (defun get-host-by-address (address) (handler-case (sb-bsd-sockets::host-ent-name (sb-bsd-sockets:get-host-by-address address)) (condition (condition) (handle-condition condition)))) -(defun get-host-by-name (name) +(defun get-hosts-by-name (name) (handler-case (sb-bsd-sockets::host-ent-addresses (sb-bsd-sockets:get-host-by-name name)) (condition (condition) (handle-condition condition)))) Added: usocket/trunk/doc/active-sockets-apis.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/active-sockets-apis.txt Sun Jan 29 15:51:23 2006 @@ -0,0 +1,19 @@ + -*- text -*- + +A document to summarizing which API's of the different implementations +are associated with 'Step 1'. + + +SBCL +==== + + sockets: + - socket-bind + - make-instance 'inet-socket + - socket-connect + - socket-close + + DNS name resolution: + - get-host-by-name + - get-host-by-address + - host-ent-addresses Modified: usocket/trunk/doc/design.txt ============================================================================== --- usocket/trunk/doc/design.txt (original) +++ usocket/trunk/doc/design.txt Sun Jan 29 15:51:23 2006 @@ -76,5 +76,4 @@ - clisp - Allegro - LispWorks - - + - OpenMCL Modified: usocket/trunk/package.lisp ============================================================================== --- usocket/trunk/package.lisp (original) +++ usocket/trunk/package.lisp Sun Jan 29 15:51:23 2006 @@ -10,22 +10,23 @@ (eval-when (:execute :load-toplevel :compile-toplevel) (defpackage :usocket (:use :cl) - (:nicknames :usoc) - (:shadowing-import-from "COMMON-LISP" :close - :open - :read-line - :write-sequence) - (:export :open ; socket related operations - :make-socket - :close - :read-line - :write-sequence - :socket ; socket object and accessors - :host - :port + (:export :socket-connect ; socket constructors and methods + :socket-close + + :usocket ; socket object and accessors + :socket-stream + :get-host-by-address ; name services + :get-hosts-by-name :get-host-by-name - :host-byte-order ; utility operators + :get-random-host-by-name + + :host-byte-order ; IPv4 utility functions + :hbo-to-dotted-quad + :hbo-to-vector-quad + :vector-quad-to-dotted-quad + :dotted-quad-to-vector-quad + :usocket-error ; conditions :no-route-to-host))) Modified: usocket/trunk/usocket.asd ============================================================================== --- usocket/trunk/usocket.asd (original) +++ usocket/trunk/usocket.asd Sun Jan 29 15:51:23 2006 @@ -13,12 +13,11 @@ (defsystem usocket :name "usocket" - :author "Erik Enge" + :author "Erik Enge & Erik Huelsmann" :version "0.1.0" :licence "MIT" :description "Universal socket library for Common Lisp" - :depends-on #+sbcl (:sb-bsd-sockets :split-sequence) - #-sbcl (:split-sequence) + :depends-on (#+sbcl :sb-bsd-sockets :split-sequence) :components ((:file "package") (:file "usocket" :depends-on ("package")) Modified: usocket/trunk/usocket.lisp ============================================================================== --- usocket/trunk/usocket.lisp (original) +++ usocket/trunk/usocket.lisp Sun Jan 29 15:51:23 2006 @@ -1,5 +1,5 @@ ;;;; $Id$ -;;;; $Source$ +;;;; $URL$ ;;;; See LICENSE for licensing information. @@ -11,7 +11,7 @@ :accessor socket) (stream :initarg :stream - :accessor stream) + :accessor socket-stream) (local-address :initarg :local-address :accessor local-address) @@ -19,15 +19,17 @@ :initarg :local-port :accessor local-port))) -(defun make-socket (&key socket local-address local-port stream)) +(defun make-socket (&key socket local-address local-port stream) (make-instance 'usocket :socket socket - :local-address host + :local-address local-address :local-port local-port :stream stream)) +(defgeneric socket-close (usocket)) + ;; -;; Utility +;; IPv4 utility functions ;; (defun list-of-strings-to-integers (list) @@ -77,3 +79,15 @@ 3232235777." (+ (* (aref vector 0) 256 256 256) (* (aref vector 1) 256 256) (* (aref vector 2) 256) (aref vector 3))) + +;; +;; DNS helper functions +;; + +(defun get-host-by-name (name) + (let ((hosts (get-hosts-by-name name))) + (car hosts))) + +(defun get-random-host-by-name (name) + (let ((hosts (get-hosts-by-name name))) + (elt hosts (random (length hosts))))) From ehuelsmann at common-lisp.net Sun Jan 29 21:53:14 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 29 Jan 2006 15:53:14 -0600 (CST) Subject: [usocket-cvs] r9 - public_html Message-ID: <20060129215314.105521B899@common-lisp.net> Author: ehuelsmann Date: Sun Jan 29 15:53:13 2006 New Revision: 9 Modified: public_html/index.shtml public_html/style.css Log: Update website. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sun Jan 29 15:53:13 2006 @@ -63,7 +63,7 @@ Implement active socket support. - TODO + WIP TODO TODO TODO Modified: public_html/style.css ============================================================================== --- public_html/style.css (original) +++ public_html/style.css Sun Jan 29 15:53:13 2006 @@ -65,3 +65,9 @@ color: #fff; font-weight: bold; text-align: center; } + +.WIP { background-color: #f80; + color: #000; + font-weight: bold; + text-align: center; } + From ehuelsmann at common-lisp.net Mon Jan 30 20:36:30 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 30 Jan 2006 14:36:30 -0600 (CST) Subject: [usocket-cvs] r10 - in usocket/trunk: backend doc Message-ID: <20060130203630.30FAB247AF@common-lisp.net> Author: ehuelsmann Date: Mon Jan 30 14:36:29 2006 New Revision: 10 Modified: usocket/trunk/backend/cmucl.lisp usocket/trunk/backend/sbcl.lisp usocket/trunk/doc/active-sockets-apis.txt Log: Update backends with current progress. Modified: usocket/trunk/backend/cmucl.lisp ============================================================================== --- usocket/trunk/backend/cmucl.lisp (original) +++ usocket/trunk/backend/cmucl.lisp Mon Jan 30 14:36:29 2006 @@ -12,21 +12,21 @@ :real-condition condition :socket socket)))) -(defun open (host port &optional (type :stream)) +(defun socket-connect (host port &optional (type :stream)) (let* ((socket (ext:connect-to-inet-socket (host-byte-order host) port type)) - (stream (sys:make-fd-stream socket :input t :output t :element-type 'character)) - (usocket (make-socket :socket socket :host host :port port :stream stream))) + (stream (sys:make-fd-stream socket :input t :output t + :element-type 'character + :buffering :full)) + ;;###FIXME the above line probably needs an :external-format + (usocket (make-socket :socket socket + :host host :port port :stream stream))) usocket)) -(defmethod close ((socket socket)) +(defmethod socket-close ((usocket usocket)) "Close socket." - (ext:close-socket (real-socket socket))) + (ext:close-socket (socket usocket))) -(defmethod read-line ((socket socket)) - (cl:read-line (real-stream socket))) -(defmethod write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-stream socket))) (defun get-host-by-address (address) (handler-case (ext:host-entry-name Modified: usocket/trunk/backend/sbcl.lisp ============================================================================== --- usocket/trunk/backend/sbcl.lisp (original) +++ usocket/trunk/backend/sbcl.lisp Mon Jan 30 14:36:29 2006 @@ -20,7 +20,12 @@ Returns a usocket object." (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket :type type :protocol :tcp)) - (stream (sb-bsd-sockets:socket-make-stream socket)) + (stream (sb-bsd-sockets:socket-make-stream socket + :input t + :output t + :buffering :full + :element-type 'character)) + ;;###FIXME: The above line probably needs an :external-format (usocket (make-instance 'usocket :stream stream :socket socket))) (handler-case (sb-bsd-sockets:socket-connect socket host port) (condition (condition) (handle-condition condition usocket))) Modified: usocket/trunk/doc/active-sockets-apis.txt ============================================================================== --- usocket/trunk/doc/active-sockets-apis.txt (original) +++ usocket/trunk/doc/active-sockets-apis.txt Mon Jan 30 14:36:29 2006 @@ -3,6 +3,14 @@ A document to summarizing which API's of the different implementations are associated with 'Step 1'. +Interface to be implemented in step 1: + + - socket-connect + - socket-close + - get-host-by-address + - get-hosts-by-name + +(and something to do with errors; maybe move this to step 1a?) SBCL ==== @@ -16,4 +24,21 @@ DNS name resolution: - get-host-by-name - get-host-by-address - - host-ent-addresses + - ::host-ent-addresses + - host-ent-name + + +CMUCL +===== + + sockets: + - ext:connect-to-inet-socket + - sys:make-fd-stream + - ext:close-socket + + DNS name resolution: + - ext:host-entry-name + - ext::lookup-host-entry + - ext:host-entry-addr-list + - ext:lookup-host-entry + From ehuelsmann at common-lisp.net Mon Jan 30 20:36:44 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 30 Jan 2006 14:36:44 -0600 (CST) Subject: [usocket-cvs] r11 - public_html Message-ID: <20060130203644.44FD42F3C3@common-lisp.net> Author: ehuelsmann Date: Mon Jan 30 14:36:42 2006 New Revision: 11 Modified: public_html/index.shtml Log: Update website. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Mon Jan 30 14:36:42 2006 @@ -53,18 +53,18 @@ trivial-sockets.
(Meaning streamed tcp traffic on connected sockets.) Investigate interfaces provided. - TODO - TODO - TODO - TODO - TODO - TODO - TODO + WIP + WIP + TODO + TODO + TODO + TODO + TODO Implement active socket support. WIP - TODO + TODO TODO TODO TODO From ehuelsmann at common-lisp.net Mon Jan 30 21:14:24 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 30 Jan 2006 15:14:24 -0600 (CST) Subject: [usocket-cvs] r12 - usocket/trunk/doc Message-ID: <20060130211424.7BB522A01A@common-lisp.net> Author: ehuelsmann Date: Mon Jan 30 15:14:23 2006 New Revision: 12 Added: usocket/trunk/doc/abcl-socket.txt usocket/trunk/doc/backends.txt Log: More backends documentation. Added: usocket/trunk/doc/abcl-socket.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/abcl-socket.txt Mon Jan 30 15:14:23 2006 @@ -0,0 +1,17 @@ + +ABCL provides a callback interface to java objects, next to these calls: + + - make-socket + - socket-close + - make-server-socket + - ext:get-socket-stream (returning an io-stream) + +abcl-swank (see SLIME) shows how to call directly into java. + + +See for the sockets implementation: + + - src/org/armedbear/lisp + * socket.lisp + * socket_stream.java + * SocketStream.java Added: usocket/trunk/doc/backends.txt ============================================================================== --- (empty file) +++ usocket/trunk/doc/backends.txt Mon Jan 30 15:14:23 2006 @@ -0,0 +1,22 @@ + -*- text -*- + +A document to describe which APIs a backend should implement. + + +Each backend should implement: + +Sockets functions: + + - socket-connect + + +Sockets methods: + + - socket-close + + +Name resolution functions: + + - get-host-by-address (name string) + - get-hosts-by-name (address vector-quad) + From ehuelsmann at common-lisp.net Tue Jan 31 18:04:58 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Tue, 31 Jan 2006 12:04:58 -0600 (CST) Subject: [usocket-cvs] r13 - usocket/trunk/backend Message-ID: <20060131180458.89E5B2A01A@common-lisp.net> Author: ehuelsmann Date: Tue Jan 31 12:04:58 2006 New Revision: 13 Modified: usocket/trunk/backend/allegro.lisp usocket/trunk/backend/clisp.lisp Log: Update clisp and allegro backends. Modified: usocket/trunk/backend/allegro.lisp ============================================================================== --- usocket/trunk/backend/allegro.lisp (original) +++ usocket/trunk/backend/allegro.lisp Tue Jan 31 12:04:58 2006 @@ -14,21 +14,18 @@ (defun open (host port &optional (type :stream)) (declare (ignore type)) - (make-socket :socket (sock:make-socket :remote-host host - :remote-port port))) + (let ((socket (sock:make-socket :remote-host host + :remote-port port))) + (make-socket :socket socket :stream socket))) -(defmethod close ((socket socket)) +(defmethod close ((usocket usocket)) "Close socket." - (sock:close (real-socket socket))) + (sock:close (socket usocket))) -(defmethod read-line ((socket socket)) - (cl:read-line (real-socket socket))) -(defmethod write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-socket socket))) (defun get-host-by-address (address) (sock:lookup-host address)) -(defun get-host-by-name (name) +(defun get-hosts-by-name (name) (sock:lookup-host name)) Modified: usocket/trunk/backend/clisp.lisp ============================================================================== --- usocket/trunk/backend/clisp.lisp (original) +++ usocket/trunk/backend/clisp.lisp Tue Jan 31 12:04:58 2006 @@ -12,29 +12,31 @@ :real-condition condition :socket socket)))) -(defun open (host port &optional (type :stream)) +(defun socket-connect (host port &optional (type :stream)) (declare (ignore type)) - (make-socket :socket (socket:socket-connect port host) - :host host - :port port)) + (let ((socket (socket:socket-connect port host + :element-type 'character + :buffered t))) + (make-socket :socket socket + :stream socket ;; the socket is a stream too + :host host + :port port)) -(defmethod close ((socket socket)) +(defmethod socket-close ((usocket usocket)) "Close socket." - (socket:socket-server-close (real-socket socket))) + (close (socket usocket))) -(defmethod read-line ((socket socket)) - (cl:read-line (real-socket socket))) -(defmethod write-sequence ((socket socket) sequence) - (cl:write-sequence sequence (real-socket socket))) (defun get-host-by-address (address) - (handler-case (posix:hostent-name - (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) - (condition (condition) (handle-condition condition)))) - -(defun get-host-by-name (name) - (handler-case (mapcar #'dotted-quad-to-vector-quad - (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) - (condition (condition) (handle-condition condition)))) - + (handler-case + (posix:hostent-name + (posix:resolve-host-ipaddr (vector-quad-to-dotted-quad address))) + (condition (condition) (handle-condition condition)))) + +(defun get-hosts-by-name (name) + (handler-case + (mapcar #'dotted-quad-to-vector-quad + (posix:hostent-addr-list (posix:resolve-host-ipaddr name))) + (condition (condition) (handle-condition condition)))) + From ehuelsmann at common-lisp.net Tue Jan 31 18:05:22 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Tue, 31 Jan 2006 12:05:22 -0600 (CST) Subject: [usocket-cvs] r14 - usocket/trunk/doc Message-ID: <20060131180522.8E6982A01A@common-lisp.net> Author: ehuelsmann Date: Tue Jan 31 12:05:22 2006 New Revision: 14 Modified: usocket/trunk/doc/active-sockets-apis.txt usocket/trunk/doc/backends.txt usocket/trunk/doc/clisp-sockets.txt usocket/trunk/doc/cmucl-sockets.txt usocket/trunk/doc/sb-bsd-sockets.txt Log: Update documentation. Modified: usocket/trunk/doc/active-sockets-apis.txt ============================================================================== --- usocket/trunk/doc/active-sockets-apis.txt (original) +++ usocket/trunk/doc/active-sockets-apis.txt Tue Jan 31 12:05:22 2006 @@ -18,6 +18,7 @@ sockets: - socket-bind - make-instance 'inet-socket + - socket-make-stream - socket-connect - socket-close Modified: usocket/trunk/doc/backends.txt ============================================================================== --- usocket/trunk/doc/backends.txt (original) +++ usocket/trunk/doc/backends.txt Tue Jan 31 12:05:22 2006 @@ -20,3 +20,7 @@ - get-host-by-address (name string) - get-hosts-by-name (address vector-quad) + +An error-handling function, resolving implementation specific errors +to this list of errors: + Modified: usocket/trunk/doc/clisp-sockets.txt ============================================================================== --- usocket/trunk/doc/clisp-sockets.txt (original) +++ usocket/trunk/doc/clisp-sockets.txt Tue Jan 31 12:05:22 2006 @@ -14,3 +14,13 @@ (SOCKET:SOCKET-STREAM-LOCAL socket-stream [do-not-resolve-p]) (SOCKET:SOCKET-STREAM-SHUTDOWN socket-stream direction) (SOCKET:SOCKET-OPTIONS socket-server &REST {option}*) + + +(posix:resolve-host-ipaddr &optional host) + +with the host-ent structure: + + name - host name + aliases - LIST of aliases + addr-list - LIST of IPs as dotted quads (IPv4) or coloned octets (IPv6) + addrtype - INTEGER address type IPv4 or IPv6 Modified: usocket/trunk/doc/cmucl-sockets.txt ============================================================================== --- usocket/trunk/doc/cmucl-sockets.txt (original) +++ usocket/trunk/doc/cmucl-sockets.txt Tue Jan 31 12:05:22 2006 @@ -34,6 +34,12 @@ +There's currently only 1 condition to be raised: + + SOCKET-ERROR (derived from SIMPLE-ERROR) + which has a SOCKET-ERRNO slot containing the unix error number. + + [Function] Modified: usocket/trunk/doc/sb-bsd-sockets.txt ============================================================================== --- usocket/trunk/doc/sb-bsd-sockets.txt (original) +++ usocket/trunk/doc/sb-bsd-sockets.txt Tue Jan 31 12:05:22 2006 @@ -86,3 +86,31 @@ (define-socket-condition sockint::EPROTONOSUPPORT protocol-not-supported-error) (define-socket-condition sockint::ESOCKTNOSUPPORT socket-type-not-supported-error) (define-socket-condition sockint::ENETUNREACH network-unreachable-error) + +Exported errors: +* (apropos "ERROR" :sb-bsd-sockets) + +SB-BSD-SOCKETS:INTERRUPTED-ERROR +SB-BSD-SOCKETS:TRY-AGAIN-ERROR +SB-BSD-SOCKETS:NO-RECOVERY-ERROR +SB-BSD-SOCKETS:CONNECTION-REFUSED-ERROR +SB-BSD-SOCKETS:INVALID-ARGUMENT-ERROR +SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR +SB-BSD-SOCKETS:OPERATION-NOT-PERMITTED-ERROR +SB-BSD-SOCKETS:SOCKET-ERROR (fbound) <-- geen condition +SB-BSD-SOCKETS:NAME-SERVICE-ERROR (fbound) <-- geen condition +? --> SB-BSD-SOCKETS:NETDB-INTERNAL-ERROR +SB-BSD-SOCKETS:OPERATION-NOT-SUPPORTED-ERROR +SB-BSD-SOCKETS:PROTOCOL-NOT-SUPPORTED-ERROR +SB-BSD-SOCKETS:OPERATION-TIMEOUT-ERROR +SB-BSD-SOCKETS:SOCKET-TYPE-NOT-SUPPORTED-ERROR +SB-BSD-SOCKETS:NO-BUFFERS-ERROR +SB-BSD-SOCKETS:NETWORK-UNREACHABLE-ERROR +? --> SB-BSD-SOCKETS:NETDB-SUCCESS-ERROR +SB-BSD-SOCKETS:BAD-FILE-DESCRIPTOR-ERROR +SB-BSD-SOCKETS:ADDRESS-IN-USE-ERROR +SB-BSD-SOCKETS:OUT-OF-MEMORY-ERROR + +And 1 non-exported error: + +SB-BSD-SOCKETS::NO-ADDRESS-ERROR From ehuelsmann at common-lisp.net Tue Jan 31 18:05:43 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Tue, 31 Jan 2006 12:05:43 -0600 (CST) Subject: [usocket-cvs] r15 - public_html Message-ID: <20060131180543.43BE92A01A@common-lisp.net> Author: ehuelsmann Date: Tue Jan 31 12:05:42 2006 New Revision: 15 Modified: public_html/index.shtml Log: Update website. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Tue Jan 31 12:05:42 2006 @@ -39,7 +39,7 @@ Minor steps SBCL CMUCL - ABCL + ABCL clisp Allegro LispWorks @@ -56,7 +56,7 @@ WIP WIP TODO - TODO + WIP TODO TODO TODO @@ -64,9 +64,9 @@ Implement active socket support. WIP - TODO - TODO + WIP TODO + WIP TODO TODO TODO From ehuelsmann at common-lisp.net Tue Jan 31 18:32:49 2006 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Tue, 31 Jan 2006 12:32:49 -0600 (CST) Subject: [usocket-cvs] r16 - public_html Message-ID: <20060131183249.46E08239FD@common-lisp.net> Author: ehuelsmann Date: Tue Jan 31 12:32:48 2006 New Revision: 16 Modified: public_html/index.shtml Log: Update website. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Tue Jan 31 12:32:48 2006 @@ -39,7 +39,7 @@ Minor steps SBCL CMUCL - ABCL + ABCL clisp Allegro LispWorks @@ -48,26 +48,37 @@ - Minimal active sockets support + Minimal active sockets support at the same level as provided by trivial-sockets.
(Meaning streamed tcp traffic on connected sockets.) Investigate interfaces provided. - WIP - WIP - TODO - WIP - TODO + WIP + WIP + WIP + WIP + WIP TODO TODO + + + Identify socket errors generated. + WIP + WIP + TODO + WIP + TODO + TODO + TODO + Implement active socket support. WIP WIP TODO WIP - TODO + WIP TODO TODO