From ehuelsmann at common-lisp.net Tue Jun 10 19:13:42 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Tue, 10 Jun 2008 15:13:42 -0400 (EDT) Subject: [usocket-cvs] r338 - public_html Message-ID: <20080610191342.4BF776A03B@common-lisp.net> Author: ehuelsmann Date: Tue Jun 10 15:13:40 2008 New Revision: 338 Modified: public_html/index.shtml Log: Add reference to the project mailing list info page. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Tue Jun 10 15:13:40 2008 @@ -86,7 +86,7 @@

Development discussion takes place on - usocket-devel at common-lisp.net. + usocket-devel at common-lisp.net.

Project tracking happens in the From ehuelsmann at common-lisp.net Thu Jun 12 19:43:04 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Thu, 12 Jun 2008 15:43:04 -0400 (EDT) Subject: [usocket-cvs] r339 - public_html Message-ID: <20080612194304.1E7123E056@common-lisp.net> Author: ehuelsmann Date: Thu Jun 12 15:43:02 2008 New Revision: 339 Modified: public_html/index.shtml Log: Update status table. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Thu Jun 12 15:43:02 2008 @@ -1,470 +1,470 @@ - - - - - <!--#include virtual="project-name" --> - - - - - -

-

-
- - - -

Goal

- -

The project wants to provide a portable TCP/IP (and later on maybe -UDP) socket interface for as many Common Lisp implementations as -possible, while keeping the abstraction and portability layer as thin -as possible.

- -

Because trivial-sockets -has been declared dead and its author has said he will declare usocket -its successor if there is a zero effort path of migration, I'm also working -on trivial-usocket which is supposed to be a sub-optimal, but zero -effort migration from trivial-sockets.

- -

If your lisp isn't mentioned in the list below, please feel free to -submit a request for it at the mailing list mentioned below.

- -

Comparison to other socket libraries

- -

Since usocket is effectively the succesor to trivial-sockets, see the - feature comparison with - trivial-sockets in order to find out which one you should use.

- -

After starting the project, many others turned out to have worked on - something alike, many times as part of a broader project or library. - Some of them were known at the start of this project, others have - been conceived after the usocket project already started. Not all of - them have exactly the same portability goal.

- -

See the Implementation - comparison page for a comparison of the portability of other - libaries and how that relates to usocket.

- - -

Documentation

- -

See the documentation page for the API description.

- -

Supported implementations

- -

Currently these implementations are supported:

- - - -

Community

- -

This project has started Januari 2006. There isn't much of a community - yet, though I'd like there to be one. So, you're invited to join - the mailing list, announce yourself and even join the effort! -

- - -

Development discussion takes place on - usocket-devel at common-lisp.net. -

- -

Project tracking happens in the - project's Trac setup. Please take note of the guidelines before - entering a bug or enhancement request into the database.

- - -
-

Development

- -

Development will at least follow the steps outlined below. - Yet to be determined is whether the currently mentioned steps will - be enough to release version 1.0. Possibly, UDP sockets remain to be - addressed before doing 1.0; that will depend on your reactions :-) -

-

The targeted implementations listed in the status table below are not - a final list: others can be added if/when the need or interest arrises. -

-

Active development is taking place in the - Subversion repository. - To be kept up to date, please - subscribe to the commit message mailing list. To use the latest - development version, make sure you have Subversion installed and - execute this command: -

- -
- $ svn checkout svn://common-lisp.net/project/usocket/svn/usocket/trunk usocket-svn
-  
- -

Please send patches, bug reports and suggestions to the development - mailing list address given above. The table below indicates the - current state of development. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Status for the currently targeted backends
Major stepsSocket implementations
Minor stepsSBCLCMUCLABCLclispAllegroLispWorksOpenMCLECLScieneer
Minimal active sockets support - at the same level as provided by - trivial-sockets.
- (Meaning streamed tcp traffic on connected sockets.)
Investigate interfaces provided.DONE DONE DONE DONE DONE DONE DONE DONE DONE
Identify socket errors generated.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement active socket support.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement remapping of implementation defined errors.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add functions to retrieve socket properties:
- Local and remote IP address and port.
Investigate interfaces providedDONE DONE DONE DONE DONE DONE DONE DONE DONE
Implement it.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add support for passive (connection-accepting/server) - sockets.Investigate interfaces providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Implement api calls listen and acceptDONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement api calls get- and setsockopt (or equivalent).TODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement efficient waiting for multiple sockets - in one function call (select() like behaviour). - Investigate interfaces providedDONEDONEDONEDONEDONE(mostly) doneDONEDONETODO
Implement wait-for-input api.DONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement more uncommon api calls - for tcp streams.send, recvTODOTODOTODOTODOTODOTODOTODOTODOTODO
shutdownTODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement udp socket support. - Investigate API's providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Build on top of that (or custom ffi).TODOTODOTODOTODOTODOTODOTODOTODOTODO
-
- -

Interface guarantees

- -

The interfaces currently published in the :export part of the -package definition are guaranteed to stay compatible for the -entire 0.x lifecycle. Extention in a backward compatible way is -ofcourse valid, as is the addition of new interface functions.

- -

Releases

- -

Current release

-

Releases are uploaded to the releases/ - directory. You can find short descriptions in the table below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Release history
DateReleaseSummary
Sep 18, 20070.3.5Implementation-dependent errors bleeding through, ECL get-host-name - memory allocation fix/win32 compat fix, CLISP compile warnings fixes, - SBCL compile warning/error fix, CLISP get-peer-name/get-local-name - fixes
Jul 25, 20070.3.4Fix clisp get-host-name, multiple ECL fixes.
Jun 05, 20070.3.3Fix where host resolution routine was unable to resolve would return - NIL instead of erroring.
Mar 04, 20070.3.2Fixes for many backends related to closing sockets. - LispWorks fix for broken server sockets. - API guarantee adjustments in preparation of porting Drakma.
Feb 28, 20070.3.1fixed with-server-socket; prevent creation of invalid sockets; - 2 more convenience macros.
Feb 26, 2007re-releaseRe-release of 0.2.3, 0.2.4, 0.2.5 and 0.3.0 tarballs - because the originals included Subversion administration areas.
Jan 21, 20070.3.0Server sockets
Jan 19, 20070.2.5Allegro compilation fix.
Jan 17, 20070.2.4Various fixes for CMUCL, OpenMCL, Allegro and LispWorks. -
Jan 04, 20070.2.3Add :element-type support to support stacking - flexi-streams on socket streams for portable :external-format - support.
Jan 03, 20070.2.2Add ECL support and a small SBCL bugfix.
Dec 21, 20060.2.1Remove 'open-stream' interface which is supposed - to be provided by the 'trivial-usocket' package.
Dec 18, 20060.2.0Add support for - Scieneer - Common Lisp, fix issue #6 and - API preparation for server side sockets (not in this release)
Feb 13, 20060.1.0Initial release
- - - - -

Project history

- -

Long ago the project was conceived and started by Erik Enge in an -attempt to factor out all implementation specific sockets code from -cl-irc. This 'long ago' must have been -way before 2003 when I entered the cl-irc project.

- -

In january 2006, Erik Huelsmann found Erik Enge willing to donate -the code he had still laying around to restart the project. The restart -took place at the 27th of january when the old code was imported into the -public repository.

- -
- -
-Back to Common-lisp.net. -
-
- Valid XHTML 1.0 Strict -
- - + + + + + <!--#include virtual="project-name" --> + + + + + +
+

+
+ + + +

Goal

+ +

The project wants to provide a portable TCP/IP (and later on maybe +UDP) socket interface for as many Common Lisp implementations as +possible, while keeping the abstraction and portability layer as thin +as possible.

+ +

Because trivial-sockets +has been declared dead and its author has said he will declare usocket +its successor if there is a zero effort path of migration, I'm also working +on trivial-usocket which is supposed to be a sub-optimal, but zero +effort migration from trivial-sockets.

+ +

If your lisp isn't mentioned in the list below, please feel free to +submit a request for it at the mailing list mentioned below.

+ +

Comparison to other socket libraries

+ +

Since usocket is effectively the succesor to trivial-sockets, see the + feature comparison with + trivial-sockets in order to find out which one you should use.

+ +

After starting the project, many others turned out to have worked on + something alike, many times as part of a broader project or library. + Some of them were known at the start of this project, others have + been conceived after the usocket project already started. Not all of + them have exactly the same portability goal.

+ +

See the Implementation + comparison page for a comparison of the portability of other + libaries and how that relates to usocket.

+ + +

Documentation

+ +

See the documentation page for the API description.

+ +

Supported implementations

+ +

Currently these implementations are supported:

+ + + +

Community

+ +

This project has started Januari 2006. There isn't much of a community + yet, though I'd like there to be one. So, you're invited to join + the mailing list, announce yourself and even join the effort! +

+ + +

Development discussion takes place on + usocket-devel at common-lisp.net. +

+ +

Project tracking happens in the + project's Trac setup. Please take note of the guidelines before + entering a bug or enhancement request into the database.

+ + +
+

Development

+ +

Development will at least follow the steps outlined below. + Yet to be determined is whether the currently mentioned steps will + be enough to release version 1.0. Possibly, UDP sockets remain to be + addressed before doing 1.0; that will depend on your reactions :-) +

+

The targeted implementations listed in the status table below are not + a final list: others can be added if/when the need or interest arrises. +

+

Active development is taking place in the + Subversion repository. + To be kept up to date, please + subscribe to the commit message mailing list. To use the latest + development version, make sure you have Subversion installed and + execute this command: +

+ +
+ $ svn checkout svn://common-lisp.net/project/usocket/svn/usocket/trunk usocket-svn
+  
+ +

Please send patches, bug reports and suggestions to the development + mailing list address given above. The table below indicates the + current state of development. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Status for the currently targeted backends
Major stepsSocket implementations
Minor stepsSBCLCMUCLABCLclispAllegroLispWorksOpenMCLECLScieneer
Minimal active sockets support + at the same level as provided by + trivial-sockets.
+ (Meaning streamed tcp traffic on connected sockets.)
Investigate interfaces provided.DONE DONE DONE DONE DONE DONE DONE DONE DONE
Identify socket errors generated.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement active socket support.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement remapping of implementation defined errors.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add functions to retrieve socket properties:
+ Local and remote IP address and port.
Investigate interfaces providedDONE DONE DONE DONE DONE DONE DONE DONE DONE
Implement it.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add support for passive (connection-accepting/server) + sockets.Investigate interfaces providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Implement api calls listen and acceptDONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement api calls get- and setsockopt (or equivalent).TODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement efficient waiting for multiple sockets + in one function call (select() like behaviour). + Investigate interfaces providedDONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement wait-for-input api.DONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement more uncommon api calls + for tcp streams.send, recvTODOTODOTODOTODOTODOTODOTODOTODOTODO
shutdownTODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement udp socket support. + Investigate API's providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Build on top of that (or custom ffi).TODOTODOTODOTODOTODOTODOTODOTODOTODO
+
+ +

Interface guarantees

+ +

The interfaces currently published in the :export part of the +package definition are guaranteed to stay compatible for the +entire 0.x lifecycle. Extention in a backward compatible way is +ofcourse valid, as is the addition of new interface functions.

+ +

Releases

+ +

Current release

+

Releases are uploaded to the releases/ + directory. You can find short descriptions in the table below:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Release history
DateReleaseSummary
Sep 18, 20070.3.5Implementation-dependent errors bleeding through, ECL get-host-name + memory allocation fix/win32 compat fix, CLISP compile warnings fixes, + SBCL compile warning/error fix, CLISP get-peer-name/get-local-name + fixes
Jul 25, 20070.3.4Fix clisp get-host-name, multiple ECL fixes.
Jun 05, 20070.3.3Fix where host resolution routine was unable to resolve would return + NIL instead of erroring.
Mar 04, 20070.3.2Fixes for many backends related to closing sockets. + LispWorks fix for broken server sockets. + API guarantee adjustments in preparation of porting Drakma.
Feb 28, 20070.3.1fixed with-server-socket; prevent creation of invalid sockets; + 2 more convenience macros.
Feb 26, 2007re-releaseRe-release of 0.2.3, 0.2.4, 0.2.5 and 0.3.0 tarballs + because the originals included Subversion administration areas.
Jan 21, 20070.3.0Server sockets
Jan 19, 20070.2.5Allegro compilation fix.
Jan 17, 20070.2.4Various fixes for CMUCL, OpenMCL, Allegro and LispWorks. +
Jan 04, 20070.2.3Add :element-type support to support stacking + flexi-streams on socket streams for portable :external-format + support.
Jan 03, 20070.2.2Add ECL support and a small SBCL bugfix.
Dec 21, 20060.2.1Remove 'open-stream' interface which is supposed + to be provided by the 'trivial-usocket' package.
Dec 18, 20060.2.0Add support for + Scieneer + Common Lisp, fix issue #6 and + API preparation for server side sockets (not in this release)
Feb 13, 20060.1.0Initial release
+ + + + +

Project history

+ +

Long ago the project was conceived and started by Erik Enge in an +attempt to factor out all implementation specific sockets code from +cl-irc. This 'long ago' must have been +way before 2003 when I entered the cl-irc project.

+ +

In january 2006, Erik Huelsmann found Erik Enge willing to donate +the code he had still laying around to restart the project. The restart +took place at the 27th of january when the old code was imported into the +public repository.

+ +
+ +
+Back to Common-lisp.net. +
+
+ Valid XHTML 1.0 Strict +
+ + From ehuelsmann at common-lisp.net Thu Jun 12 19:46:06 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Thu, 12 Jun 2008 15:46:06 -0400 (EDT) Subject: [usocket-cvs] r340 - public_html Message-ID: <20080612194606.407A4671D6@common-lisp.net> Author: ehuelsmann Date: Thu Jun 12 15:46:00 2008 New Revision: 340 Modified: public_html/api-docs.shtml (props changed) public_html/feature-comparison.shtml (props changed) public_html/implementation-comparison.shtml (props changed) public_html/index.shtml (contents, props changed) public_html/project-name (props changed) public_html/style.css (props changed) Log: Set eol-style. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Thu Jun 12 15:46:00 2008 @@ -1,470 +1,470 @@ - - - - - <!--#include virtual="project-name" --> - - - - - -
-

-
- - - -

Goal

- -

The project wants to provide a portable TCP/IP (and later on maybe -UDP) socket interface for as many Common Lisp implementations as -possible, while keeping the abstraction and portability layer as thin -as possible.

- -

Because trivial-sockets -has been declared dead and its author has said he will declare usocket -its successor if there is a zero effort path of migration, I'm also working -on trivial-usocket which is supposed to be a sub-optimal, but zero -effort migration from trivial-sockets.

- -

If your lisp isn't mentioned in the list below, please feel free to -submit a request for it at the mailing list mentioned below.

- -

Comparison to other socket libraries

- -

Since usocket is effectively the succesor to trivial-sockets, see the - feature comparison with - trivial-sockets in order to find out which one you should use.

- -

After starting the project, many others turned out to have worked on - something alike, many times as part of a broader project or library. - Some of them were known at the start of this project, others have - been conceived after the usocket project already started. Not all of - them have exactly the same portability goal.

- -

See the Implementation - comparison page for a comparison of the portability of other - libaries and how that relates to usocket.

- - -

Documentation

- -

See the documentation page for the API description.

- -

Supported implementations

- -

Currently these implementations are supported:

- - - -

Community

- -

This project has started Januari 2006. There isn't much of a community - yet, though I'd like there to be one. So, you're invited to join - the mailing list, announce yourself and even join the effort! -

- - -

Development discussion takes place on - usocket-devel at common-lisp.net. -

- -

Project tracking happens in the - project's Trac setup. Please take note of the guidelines before - entering a bug or enhancement request into the database.

- - -
-

Development

- -

Development will at least follow the steps outlined below. - Yet to be determined is whether the currently mentioned steps will - be enough to release version 1.0. Possibly, UDP sockets remain to be - addressed before doing 1.0; that will depend on your reactions :-) -

-

The targeted implementations listed in the status table below are not - a final list: others can be added if/when the need or interest arrises. -

-

Active development is taking place in the - Subversion repository. - To be kept up to date, please - subscribe to the commit message mailing list. To use the latest - development version, make sure you have Subversion installed and - execute this command: -

- -
- $ svn checkout svn://common-lisp.net/project/usocket/svn/usocket/trunk usocket-svn
-  
- -

Please send patches, bug reports and suggestions to the development - mailing list address given above. The table below indicates the - current state of development. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Status for the currently targeted backends
Major stepsSocket implementations
Minor stepsSBCLCMUCLABCLclispAllegroLispWorksOpenMCLECLScieneer
Minimal active sockets support - at the same level as provided by - trivial-sockets.
- (Meaning streamed tcp traffic on connected sockets.)
Investigate interfaces provided.DONE DONE DONE DONE DONE DONE DONE DONE DONE
Identify socket errors generated.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement active socket support.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement remapping of implementation defined errors.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add functions to retrieve socket properties:
- Local and remote IP address and port.
Investigate interfaces providedDONE DONE DONE DONE DONE DONE DONE DONE DONE
Implement it.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add support for passive (connection-accepting/server) - sockets.Investigate interfaces providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Implement api calls listen and acceptDONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement api calls get- and setsockopt (or equivalent).TODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement efficient waiting for multiple sockets - in one function call (select() like behaviour). - Investigate interfaces providedDONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement wait-for-input api.DONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement more uncommon api calls - for tcp streams.send, recvTODOTODOTODOTODOTODOTODOTODOTODOTODO
shutdownTODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement udp socket support. - Investigate API's providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Build on top of that (or custom ffi).TODOTODOTODOTODOTODOTODOTODOTODOTODO
-
- -

Interface guarantees

- -

The interfaces currently published in the :export part of the -package definition are guaranteed to stay compatible for the -entire 0.x lifecycle. Extention in a backward compatible way is -ofcourse valid, as is the addition of new interface functions.

- -

Releases

- -

Current release

-

Releases are uploaded to the releases/ - directory. You can find short descriptions in the table below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Release history
DateReleaseSummary
Sep 18, 20070.3.5Implementation-dependent errors bleeding through, ECL get-host-name - memory allocation fix/win32 compat fix, CLISP compile warnings fixes, - SBCL compile warning/error fix, CLISP get-peer-name/get-local-name - fixes
Jul 25, 20070.3.4Fix clisp get-host-name, multiple ECL fixes.
Jun 05, 20070.3.3Fix where host resolution routine was unable to resolve would return - NIL instead of erroring.
Mar 04, 20070.3.2Fixes for many backends related to closing sockets. - LispWorks fix for broken server sockets. - API guarantee adjustments in preparation of porting Drakma.
Feb 28, 20070.3.1fixed with-server-socket; prevent creation of invalid sockets; - 2 more convenience macros.
Feb 26, 2007re-releaseRe-release of 0.2.3, 0.2.4, 0.2.5 and 0.3.0 tarballs - because the originals included Subversion administration areas.
Jan 21, 20070.3.0Server sockets
Jan 19, 20070.2.5Allegro compilation fix.
Jan 17, 20070.2.4Various fixes for CMUCL, OpenMCL, Allegro and LispWorks. -
Jan 04, 20070.2.3Add :element-type support to support stacking - flexi-streams on socket streams for portable :external-format - support.
Jan 03, 20070.2.2Add ECL support and a small SBCL bugfix.
Dec 21, 20060.2.1Remove 'open-stream' interface which is supposed - to be provided by the 'trivial-usocket' package.
Dec 18, 20060.2.0Add support for - Scieneer - Common Lisp, fix issue #6 and - API preparation for server side sockets (not in this release)
Feb 13, 20060.1.0Initial release
- - - - -

Project history

- -

Long ago the project was conceived and started by Erik Enge in an -attempt to factor out all implementation specific sockets code from -cl-irc. This 'long ago' must have been -way before 2003 when I entered the cl-irc project.

- -

In january 2006, Erik Huelsmann found Erik Enge willing to donate -the code he had still laying around to restart the project. The restart -took place at the 27th of january when the old code was imported into the -public repository.

- -
- -
-Back to Common-lisp.net. -
-
- Valid XHTML 1.0 Strict -
- - + + + + + <!--#include virtual="project-name" --> + + + + + +
+

+
+ + + +

Goal

+ +

The project wants to provide a portable TCP/IP (and later on maybe +UDP) socket interface for as many Common Lisp implementations as +possible, while keeping the abstraction and portability layer as thin +as possible.

+ +

Because trivial-sockets +has been declared dead and its author has said he will declare usocket +its successor if there is a zero effort path of migration, I'm also working +on trivial-usocket which is supposed to be a sub-optimal, but zero +effort migration from trivial-sockets.

+ +

If your lisp isn't mentioned in the list below, please feel free to +submit a request for it at the mailing list mentioned below.

+ +

Comparison to other socket libraries

+ +

Since usocket is effectively the succesor to trivial-sockets, see the + feature comparison with + trivial-sockets in order to find out which one you should use.

+ +

After starting the project, many others turned out to have worked on + something alike, many times as part of a broader project or library. + Some of them were known at the start of this project, others have + been conceived after the usocket project already started. Not all of + them have exactly the same portability goal.

+ +

See the Implementation + comparison page for a comparison of the portability of other + libaries and how that relates to usocket.

+ + +

Documentation

+ +

See the documentation page for the API description.

+ +

Supported implementations

+ +

Currently these implementations are supported:

+ + + +

Community

+ +

This project has started Januari 2006. There isn't much of a community + yet, though I'd like there to be one. So, you're invited to join + the mailing list, announce yourself and even join the effort! +

+ + +

Development discussion takes place on + usocket-devel at common-lisp.net. +

+ +

Project tracking happens in the + project's Trac setup. Please take note of the guidelines before + entering a bug or enhancement request into the database.

+ + +
+

Development

+ +

Development will at least follow the steps outlined below. + Yet to be determined is whether the currently mentioned steps will + be enough to release version 1.0. Possibly, UDP sockets remain to be + addressed before doing 1.0; that will depend on your reactions :-) +

+

The targeted implementations listed in the status table below are not + a final list: others can be added if/when the need or interest arrises. +

+

Active development is taking place in the + Subversion repository. + To be kept up to date, please + subscribe to the commit message mailing list. To use the latest + development version, make sure you have Subversion installed and + execute this command: +

+ +
+ $ svn checkout svn://common-lisp.net/project/usocket/svn/usocket/trunk usocket-svn
+  
+ +

Please send patches, bug reports and suggestions to the development + mailing list address given above. The table below indicates the + current state of development. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Status for the currently targeted backends
Major stepsSocket implementations
Minor stepsSBCLCMUCLABCLclispAllegroLispWorksOpenMCLECLScieneer
Minimal active sockets support + at the same level as provided by + trivial-sockets.
+ (Meaning streamed tcp traffic on connected sockets.)
Investigate interfaces provided.DONE DONE DONE DONE DONE DONE DONE DONE DONE
Identify socket errors generated.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement active socket support.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement remapping of implementation defined errors.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add functions to retrieve socket properties:
+ Local and remote IP address and port.
Investigate interfaces providedDONE DONE DONE DONE DONE DONE DONE DONE DONE
Implement it.DONEDONEDONEDONEDONEDONEDONEDONEDONE
Implementation test-suite statusPASSPASSPASSPASSPASSPASSPASSPASSPASS
Add support for passive (connection-accepting/server) + sockets.Investigate interfaces providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Implement api calls listen and acceptDONEDONEDONEDONEDONEDONEDONEDONEDONE
Implement api calls get- and setsockopt (or equivalent).TODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement efficient waiting for multiple sockets + in one function call (select() like behaviour). + Investigate interfaces providedDONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement wait-for-input api.DONEDONEDONEDONEDONEdoneDONEDONEDONE
Implement more uncommon api calls + for tcp streams.send, recvTODOTODOTODOTODOTODOTODOTODOTODOTODO
shutdownTODOTODOTODOTODOTODOTODOTODOTODOTODO
Implement udp socket support. + Investigate API's providedWIPWIPWIPWIPWIPWIPWIPWIPWIP
Build on top of that (or custom ffi).TODOTODOTODOTODOTODOTODOTODOTODOTODO
+
+ +

Interface guarantees

+ +

The interfaces currently published in the :export part of the +package definition are guaranteed to stay compatible for the +entire 0.x lifecycle. Extention in a backward compatible way is +ofcourse valid, as is the addition of new interface functions.

+ +

Releases

+ +

Current release

+

Releases are uploaded to the releases/ + directory. You can find short descriptions in the table below:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Release history
DateReleaseSummary
Sep 18, 20070.3.5Implementation-dependent errors bleeding through, ECL get-host-name + memory allocation fix/win32 compat fix, CLISP compile warnings fixes, + SBCL compile warning/error fix, CLISP get-peer-name/get-local-name + fixes
Jul 25, 20070.3.4Fix clisp get-host-name, multiple ECL fixes.
Jun 05, 20070.3.3Fix where host resolution routine was unable to resolve would return + NIL instead of erroring.
Mar 04, 20070.3.2Fixes for many backends related to closing sockets. + LispWorks fix for broken server sockets. + API guarantee adjustments in preparation of porting Drakma.
Feb 28, 20070.3.1fixed with-server-socket; prevent creation of invalid sockets; + 2 more convenience macros.
Feb 26, 2007re-releaseRe-release of 0.2.3, 0.2.4, 0.2.5 and 0.3.0 tarballs + because the originals included Subversion administration areas.
Jan 21, 20070.3.0Server sockets
Jan 19, 20070.2.5Allegro compilation fix.
Jan 17, 20070.2.4Various fixes for CMUCL, OpenMCL, Allegro and LispWorks. +
Jan 04, 20070.2.3Add :element-type support to support stacking + flexi-streams on socket streams for portable :external-format + support.
Jan 03, 20070.2.2Add ECL support and a small SBCL bugfix.
Dec 21, 20060.2.1Remove 'open-stream' interface which is supposed + to be provided by the 'trivial-usocket' package.
Dec 18, 20060.2.0Add support for + Scieneer + Common Lisp, fix issue #6 and + API preparation for server side sockets (not in this release)
Feb 13, 20060.1.0Initial release
+ + + + +

Project history

+ +

Long ago the project was conceived and started by Erik Enge in an +attempt to factor out all implementation specific sockets code from +cl-irc. This 'long ago' must have been +way before 2003 when I entered the cl-irc project.

+ +

In january 2006, Erik Huelsmann found Erik Enge willing to donate +the code he had still laying around to restart the project. The restart +took place at the 27th of january when the old code was imported into the +public repository.

+ +
+ +
+Back to Common-lisp.net. +
+
+ Valid XHTML 1.0 Strict +
+ + From ehuelsmann at common-lisp.net Sat Jun 14 18:32:57 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 14 Jun 2008 14:32:57 -0400 (EDT) Subject: [usocket-cvs] r341 - usocket/trunk/backend Message-ID: <20080614183257.11615761AD@common-lisp.net> Author: ehuelsmann Date: Sat Jun 14 14:32:57 2008 New Revision: 341 Modified: usocket/trunk/backend/lispworks.lisp Log: Fix 2 issues: 1) MAPCAR doesn't take a :key argument, 2) use a stream-argument for LISTEN Found by: binghe Chun Tian Modified: usocket/trunk/backend/lispworks.lisp ============================================================================== --- usocket/trunk/backend/lispworks.lisp (original) +++ usocket/trunk/backend/lispworks.lisp Sat Jun 14 14:32:57 2008 @@ -157,7 +157,7 @@ (defun usocket-listen (usocket) (if (stream-usocket-p usocket) - (when (listen (socket usocket)) + (when (listen (socket-stream usocket)) usocket) (when (comm::socket-listen (socket usocket)) usocket))) @@ -174,15 +174,15 @@ ;; unfortunately, it's impossible to share code between ;; non-win32 and win32 platforms... ;; Can we have a sane -pref. complete [UDP!?]- API next time, please? - (mapcar #'mp:notice-fd sockets - :key #'os-socket-handle) + (dolist (x sockets) + (mp:notice-fd (os-socket-handle x))) (mp:process-wait-with-timeout "Waiting for a socket to become active" (truncate timeout) #'(lambda (socks) (some #'usocket-listen socks)) sockets) - (mapcar #'mp:unnotice-fd sockets - :key #'os-socket-handle) + (dolist (x sockets) + (mp:unnotice-fd (os-socket-handle x))) (remove nil (mapcar #'usocket-listen sockets)))) From ehuelsmann at common-lisp.net Sun Jun 15 12:28:41 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 15 Jun 2008 08:28:41 -0400 (EDT) Subject: [usocket-cvs] r342 - usocket/branches/new-wfi Message-ID: <20080615122841.E369B69006@common-lisp.net> Author: ehuelsmann Date: Sun Jun 15 08:28:40 2008 New Revision: 342 Added: usocket/branches/new-wfi/ - copied from r341, usocket/trunk/ Log: Create new WAIT-FOR-INPUT branch, hopefully performing more to hhubner's expectations. From ehuelsmann at common-lisp.net Sun Jun 15 21:17:24 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sun, 15 Jun 2008 17:17:24 -0400 (EDT) Subject: [usocket-cvs] r343 - in usocket/branches/new-wfi: . backend Message-ID: <20080615211724.5C06C1B000@common-lisp.net> Author: ehuelsmann Date: Sun Jun 15 17:17:23 2008 New Revision: 343 Added: usocket/branches/new-wfi/BRANCH-README (contents, props changed) Modified: usocket/branches/new-wfi/backend/allegro.lisp usocket/branches/new-wfi/backend/clisp.lisp usocket/branches/new-wfi/backend/cmucl.lisp usocket/branches/new-wfi/backend/lispworks.lisp usocket/branches/new-wfi/backend/openmcl.lisp usocket/branches/new-wfi/usocket.lisp Log: Populate new-WAIT-FOR-INPUT branch with intended API. Added: usocket/branches/new-wfi/BRANCH-README ============================================================================== --- (empty file) +++ usocket/branches/new-wfi/BRANCH-README Sun Jun 15 17:17:23 2008 @@ -0,0 +1,8 @@ + + +At least these backends are broken, for now: + + - ABCL + - LispWorks (Win32) + - SBCL/ ECL + - Scieneer Modified: usocket/branches/new-wfi/backend/allegro.lisp ============================================================================== --- usocket/branches/new-wfi/backend/allegro.lisp (original) +++ usocket/branches/new-wfi/backend/allegro.lisp Sun Jun 15 17:17:23 2008 @@ -127,18 +127,29 @@ (list (hbo-to-vector-quad (socket:lookup-hostname (host-to-hostname name)))))) -(defun wait-for-input-internal (sockets &key timeout) +(defun %setup-wait-list (wait-list) + (declare (ignore wait-list))) + +(defun %add-waiter (wait-list waiter) + (push (socket waiter) (%wait wait-list))) + +(defun %remove-waiter (wait-list waiter) + (setf (%wait wait-list) + (remove (socket waiter) (%wait wait-list)))) + +(defun wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () (let ((active-internal-sockets (if timeout - (mp:wait-for-input-available (mapcar #'socket sockets) + (mp:wait-for-input-available (%wait wait-list) :timeout timeout) - (mp:wait-for-input-available (mapcar #'socket sockets))))) + (mp:wait-for-input-available (%wait wait-list))))) ;; this is quadratic, but hey, the active-internal-sockets ;; list is very short and it's only quadratic in the length of that one. ;; When I have more time I could recode it to something of linear ;; complexity. - ;; [Same code is also used in lispworks.lisp, openmcl.lisp] - (remove-if #'(lambda (x) - (not (member (socket x) active-internal-sockets))) - sockets)))) + ;; [Same code is also used in openmcl.lisp] + (dolist (x active-internal-sockets) + (setf (state (gethash x (wait-map wait-list))) + :READ)) + wait-list))) Modified: usocket/branches/new-wfi/backend/clisp.lisp ============================================================================== --- usocket/branches/new-wfi/backend/clisp.lisp (original) +++ usocket/branches/new-wfi/backend/clisp.lisp Sun Jun 15 17:17:23 2008 @@ -127,23 +127,33 @@ (nth-value 1 (get-peer-name usocket))) -(defmethod wait-for-input-internal (sockets &key timeout) +(defun %setup-wait-list (wait-list) + (declare (ignore wait-list))) + +(defun %add-waiter (wait-list waiter) + (push (cons (socket waiter) NIL) (%wait wait-list))) + +(defun %remove-waiter (wait-list waiter) + (setf (%wait wait-list) + (remove (socket waiter) (%wait wait-list) :key #'car))) + +(defmethod wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () (multiple-value-bind (secs musecs) (split-timeout (or timeout 1)) - (let* ((request-list (mapcar #'(lambda (x) - (if (stream-server-usocket-p x) - (socket x) - (list (socket x) :input))) - sockets)) - (status-list (if timeout + (dolist (x (%wait wait-list)) + (setf (cdr x) :INPUT)) + (let* ((status-list (if timeout (socket:socket-status request-list secs musecs) - (socket:socket-status request-list)))) - (remove nil - (mapcar #'(lambda (x y) - (when y x)) - sockets status-list)))))) + (socket:socket-status request-list))) + (sockets (wait-list wait-list))) + (do* ((x (pop sockets) (pop sockets)) + (y (pop status-list) (pop status-list))) + ((or (null sockets) (null status-list))) + (when y + (setf (state x) :READ))) + wait-list)))) ;; Modified: usocket/branches/new-wfi/backend/cmucl.lisp ============================================================================== --- usocket/branches/new-wfi/backend/cmucl.lisp (original) +++ usocket/branches/new-wfi/backend/cmucl.lisp Sun Jun 15 17:17:23 2008 @@ -162,26 +162,35 @@ (defun get-host-name () (unix:unix-gethostname)) -(defun wait-for-input-internal (sockets &key timeout) +(defun %setup-wait-list (wait-list) + (declare (ignore wait-list))) + +(defun %add-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + +(defun %remove-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + +(defun wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () (alien:with-alien ((rfds (alien:struct unix:fd-set))) (unix:fd-zero rfds) - (dolist (socket sockets) + (dolist (socket (wait-list wait-list)) (unix:fd-set (socket socket) rfds)) (multiple-value-bind (secs musecs) (split-timeout (or timeout 1)) (multiple-value-bind (count err) - (unix:unix-fast-select (1+ (reduce #'max sockets + (unix:unix-fast-select (1+ (reduce #'max (wait-list wait-list) :key #'socket)) (alien:addr rfds) nil nil (when timeout secs) musecs) (if (<= 0 count) ;; process the result... - (remove-if #'(lambda (x) - (not (unix:fd-isset (socket x) rfds))) - sockets) + (dolist (x (wait-list wait-list)) + (when (unix:fd-isset (socket x) rfds) + (setf (state x) :READ))) (progn ;;###FIXME generate an error, except for EINTR ))))))) Modified: usocket/branches/new-wfi/backend/lispworks.lisp ============================================================================== --- usocket/branches/new-wfi/backend/lispworks.lisp (original) +++ usocket/branches/new-wfi/backend/lispworks.lisp Sun Jun 15 17:17:23 2008 @@ -169,21 +169,36 @@ ;;; #-win32 -(defun wait-for-input-internal (sockets &key timeout) - (with-mapped-conditions () - ;; unfortunately, it's impossible to share code between - ;; non-win32 and win32 platforms... - ;; Can we have a sane -pref. complete [UDP!?]- API next time, please? - (dolist (x sockets) - (mp:notice-fd (os-socket-handle x))) - (mp:process-wait-with-timeout "Waiting for a socket to become active" - (truncate timeout) - #'(lambda (socks) - (some #'usocket-listen socks)) - sockets) - (dolist (x sockets) - (mp:unnotice-fd (os-socket-handle x))) - (remove nil (mapcar #'usocket-listen sockets)))) +(progn + + (defun %setup-wait-list (wait-list) + (declare (ignore wait-list))) + + (defun %add-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + + (defun %remove-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + + (defun wait-for-input-internal (wait-list &key timeout) + (with-mapped-conditions () + ;; unfortunately, it's impossible to share code between + ;; non-win32 and win32 platforms... + ;; Can we have a sane -pref. complete [UDP!?]- API next time, please? + (dolist (x (wait-list wait-list)) + (mp:notice-fd (os-socket-handle x))) + (mp:process-wait-with-timeout "Waiting for a socket to become active" + (truncate timeout) + #'(lambda (socks) + (let (rv) + (dolist (x socks rv) + (when (usocket-listen x) + (setf (state x) :READ + rv t))))) + (wait-list wait-list)) + (dolist (x (wait-list wait-list)) + (mp:unnotice-fd (os-socket-handle x))) + wait-list))) ;;; Modified: usocket/branches/new-wfi/backend/openmcl.lisp ============================================================================== --- usocket/branches/new-wfi/backend/openmcl.lisp (original) +++ usocket/branches/new-wfi/backend/openmcl.lisp Sun Jun 15 17:17:23 2008 @@ -32,21 +32,23 @@ (defun input-available-p (sockets &optional ticks-to-wait) (ccl::rletZ ((tv :timeval)) (ccl::ticks-to-timeval ticks-to-wait tv) + ;;### The trickery below can be moved to the wait-list now... (ccl::%stack-block ((infds ccl::*fd-set-size*)) (ccl::fd-zero infds) (let ((max-fd -1)) (dolist (sock sockets) - (let ((fd (openmcl-socket:socket-os-fd sock))) + (let ((fd (openmcl-socket:socket-os-fd (socket sock)))) (setf max-fd (max max-fd fd)) (ccl::fd-set fd infds))) (let* ((res (#_select (1+ max-fd) infds (ccl::%null-ptr) (ccl::%null-ptr) (if ticks-to-wait tv (ccl::%null-ptr))))) (when (> res 0) - (remove-if #'(lambda (x) - (not (ccl::fd-is-set (openmcl-socket:socket-os-fd x) - infds))) - sockets))))))) + (dolist (x sockets) + (when (ccl::fd-is-set (openmcl-socket:socket-os-fd (socket x)) + infds) + (setf (state x) :READ)))) + sockets))))) (defun raise-error-from-id (condition-id socket real-condition) (let ((usock-err (cdr (assoc condition-id +openmcl-error-map+)))) @@ -136,19 +138,23 @@ (list (hbo-to-vector-quad (openmcl-socket:lookup-hostname (host-to-hostname name)))))) -(defun wait-for-input-internal (sockets &key timeout) + +(defun %setup-wait-list (wait-list) + (declare (ignore wait-list))) + +(defun %add-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + +(defun %remove-waiter (wait-list waiter) + (declare (ignore wait-list waiter))) + +(defun wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () - (let* ((ticks-timeout (truncate (* (or timeout 1) ccl::*ticks-per-second*))) + (let* ((ticks-timeout (truncate (* (or timeout 1) + ccl::*ticks-per-second*))) (active-internal-sockets - (input-available-p (mapcar #'socket sockets) + (input-available-p wait-list (when timeout ticks-timeout)))) - ;; this is quadratic, but hey, the active-internal-sockets - ;; list is very short and it's only quadratic in the length of that one. - ;; When I have more time I could recode it to something of linear - ;; complexity. - ;; [Same code is also used in lispworks.lisp, allegro.lisp] - (remove-if #'(lambda (x) - (not (member (socket x) active-internal-sockets))) - sockets)))) + wait-list))) Modified: usocket/branches/new-wfi/usocket.lisp ============================================================================== --- usocket/branches/new-wfi/usocket.lisp (original) +++ usocket/branches/new-wfi/usocket.lisp Sun Jun 15 17:17:23 2008 @@ -15,7 +15,20 @@ ((socket :initarg :socket :accessor socket - :documentation "Implementation specific socket object instance.")) + :documentation "Implementation specific socket object instance.'") + (state + :initform nil + :accessor state + :documentation "Per-socket return value for the `wait-for-input' function. + +The value stored in this slot can be any of + NIL - not ready + :READ - ready to read + :READ-WRITE - ready to read and write + :WRITE - ready to write + +The last two remain unused in the current version. +")) (:documentation "The main socket class. @@ -33,7 +46,7 @@ )) (:documentation "Stream socket class. - +' Contrary to other sockets, these sockets may be closed either with the `socket-close' method or by closing the associated stream (which can be retrieved with the `socket-stream' accessor).")) @@ -201,10 +214,46 @@ , at body)) -(defgeneric wait-for-input (socket-or-sockets - &key timeout) - (:documentation -"Waits for one or more streams to become ready for reading from +(defstruct (wait-list (:constructor %make-wait-list)) + (%wait ;; implementation specific + wait-list ;; the list of all usockets + wait-map ;; maps implementation sockets to usockets + )) + +;; Implementation specific: +;; +;; %setup-wait-list +;; add-waiter +;; remove-waiter + +(declaim (inline %setup-wait-list + %add-waiter + %remove-waiter)) + +(defun make-wait-list (waiters) + (let ((wl (%make-wait-list))) + (setf (wait-map wl) (make-hash-table)) + (%setup-wait-list wl) + (dolist (x waiters) + (add-waiter wl x)) + wl)) + +(defun add-waiter (wait-list input) + (setf (gethash (socket input) (wait-map wait-list)) input) + (pushnew input (wait-list wait-list)) + (%add-waiter wait-list input)) + +(defun remove-waiter (wait-list input) + (%remove-waiter wait-list input) + (setf (wait-list wait-list) + (remove input (wait-list wait-list))) + (remhash (socket input) (wait-map wait-list))) + + + + +(defun wait-for-input (socket-or-sockets &key timeout ready-only) + "Waits for one or more streams to become ready for reading from the socket. When `timeout' (a non-negative real number) is specified, wait `timeout' seconds, or wait indefinitely when it isn't specified. A `timeout' value of 0 (zero) means polling. @@ -214,46 +263,51 @@ be returned for this value either when waiting timed out or when it was interrupted (EINTR). The second value is a real number indicating the time remaining within the timeout period or NIL if -none.")) - - -(defmethod wait-for-input (socket-or-sockets &key timeout) +none." + (unless (wait-list-p socket-or-sockets) + (let ((wl (make-wait-list (if (listp socket-or-sockets) + socket-or-sockets (list socket-or-sockets)) + nil))) + (multiple-value-bind + (socks to) + (wait-for-input wl :timeout timeout :ready-only ready-only) + (return-from wait-for-input + (values (if ready-only socks socket-or-sockets) to))))) (let* ((start (get-internal-real-time)) - (sockets (if (listp socket-or-sockets) - socket-or-sockets - (list socket-or-sockets))) - ;; retrieve a list of all sockets which are ready without waiting - (ready-sockets - (remove-if (complement #'(lambda (x) - (and (stream-usocket-p x) - (listen (socket-stream x))))) - sockets)) + (sockets-ready 0)) + (dolist (x (wait-list sockets)) + (when (setf (state x) + (if (and (stream-usocket-p x) + (listen (socket-stream x))) + :READ NIL)) + (incf sockets-ready))) ;; the internal routine is responsibe for ;; making sure the wait doesn't block on socket-streams of - ;; which the socket isn't ready, but there's space left in the + ;; which theready- socket isn't ready, but there's space left in the ;; buffer - (result (wait-for-input-internal - sockets - :timeout (if (null ready-sockets) timeout 0)))) - (values (union ready-sockets result) - (when timeout - (let ((elapsed (/ (- (get-internal-real-time) start) - internal-time-units-per-second))) - (when (< elapsed timeout) - (- timeout elapsed))))))) - + (wait-for-input-internal socket-or-sockets + :timeout (if (zerop sockets-ready) timeout 0)) + (let ((to-result (when timeout + (let ((elapsed (/ (- (get-internal-real-time) start) + internal-time-units-per-second))) + (when (< elapsed timeout) + (- timeout elapsed)))))) + (values (if ready-only + (remove-if #'null (wait-list socket-or-sockets) :key #'state) + socket-or-sockets) + to-result)))) ;; ;; Data utility functions ;; -(defun integer-to-octet-buffer (integer buffer octets &key (start 0)) +(defun integer-to-octready-et-buffer (integer buffer octets &key (start 0)) (do ((b start (1+ b)) (i (ash (1- octets) 3) ;; * 8 (- i 8))) ((> 0 i) buffer) (setf (aref buffer b) - (ldb (byte 8 i) integer)))) + (ldb (byteready- 8 i) integer)))) (defun octet-buffer-to-integer (buffer octets &key (start 0)) (let ((integer 0)) @@ -369,7 +423,7 @@ (when hosts (elt hosts (random (length hosts)))))) - (defun host-to-vector-quad (host) + (defun host-toready--vector-quad (host) "Translate a host specification (vector quad, dotted quad or domain name) to a vector quad." (etypecase host @@ -392,7 +446,7 @@ ((vector t 4) (host-byte-order host)) (integer host)))) -;; +;;ready- ;; Other utility functions ;; @@ -416,7 +470,7 @@ ;; ;; (defun SOCKET-CONNECT (host port &key element-type) ..) ;; - +ready-ready- (setf (documentation 'socket-connect 'function) "Connect to `host' on `port'. `host' is assumed to be a string or an IP address represented in vector notation, such as #(192 168 1 1). @@ -433,7 +487,7 @@ ;;###FIXME: extend with default-element-type (setf (documentation 'socket-listen 'function) "Bind to interface `host' on `port'. `host' should be the -representation of an interface address. The implementation is not +representation of an ready-interface address. The implementation is not required to do an address lookup, making no guarantees that hostnames will be correctly resolved. If `*wildcard-host*' is passed for `host', the socket will be bound to all available interfaces for the IPv4 @@ -447,4 +501,4 @@ streams to be created by `socket-accept'. `reuseaddress' is supported for backward compatibility (but deprecated); when both `reuseaddress' and `reuse-address' have been specified, the latter takes precedence. -") +")ready-ready- From ehuelsmann at common-lisp.net Mon Jun 16 21:31:21 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 16 Jun 2008 17:31:21 -0400 (EDT) Subject: [usocket-cvs] r344 - in usocket/branches/new-wfi: . backend Message-ID: <20080616213121.AAA0E67045@common-lisp.net> Author: ehuelsmann Date: Mon Jun 16 17:31:21 2008 New Revision: 344 Modified: usocket/branches/new-wfi/backend/lispworks.lisp usocket/branches/new-wfi/usocket.lisp Log: Fix general usocket breakage and lispworks/non-win32. Modified: usocket/branches/new-wfi/backend/lispworks.lisp ============================================================================== --- usocket/branches/new-wfi/backend/lispworks.lisp (original) +++ usocket/branches/new-wfi/backend/lispworks.lisp Mon Jun 16 17:31:21 2008 @@ -185,7 +185,7 @@ ;; unfortunately, it's impossible to share code between ;; non-win32 and win32 platforms... ;; Can we have a sane -pref. complete [UDP!?]- API next time, please? - (dolist (x (wait-list wait-list)) + (dolist (x (wait-list-waiters wait-list)) (mp:notice-fd (os-socket-handle x))) (mp:process-wait-with-timeout "Waiting for a socket to become active" (truncate timeout) @@ -195,8 +195,8 @@ (when (usocket-listen x) (setf (state x) :READ rv t))))) - (wait-list wait-list)) - (dolist (x (wait-list wait-list)) + (wait-list-waiters wait-list)) + (dolist (x (wait-list-waiters wait-list)) (mp:unnotice-fd (os-socket-handle x))) wait-list))) Modified: usocket/branches/new-wfi/usocket.lisp ============================================================================== --- usocket/branches/new-wfi/usocket.lisp (original) +++ usocket/branches/new-wfi/usocket.lisp Mon Jun 16 17:31:21 2008 @@ -215,10 +215,10 @@ (defstruct (wait-list (:constructor %make-wait-list)) - (%wait ;; implementation specific - wait-list ;; the list of all usockets - wait-map ;; maps implementation sockets to usockets - )) + %wait ;; implementation specific + waiters ;; the list of all usockets + map ;; maps implementation sockets to usockets + ) ;; Implementation specific: ;; @@ -232,22 +232,22 @@ (defun make-wait-list (waiters) (let ((wl (%make-wait-list))) - (setf (wait-map wl) (make-hash-table)) + (setf (wait-list-map wl) (make-hash-table)) (%setup-wait-list wl) (dolist (x waiters) (add-waiter wl x)) wl)) (defun add-waiter (wait-list input) - (setf (gethash (socket input) (wait-map wait-list)) input) - (pushnew input (wait-list wait-list)) + (setf (gethash (socket input) (wait-list-map wait-list)) input) + (pushnew input (wait-list-waiters wait-list)) (%add-waiter wait-list input)) (defun remove-waiter (wait-list input) (%remove-waiter wait-list input) - (setf (wait-list wait-list) - (remove input (wait-list wait-list))) - (remhash (socket input) (wait-map wait-list))) + (setf (wait-list-waiters wait-list) + (remove input (wait-list-waiters wait-list))) + (remhash (socket input) (wait-list-map wait-list))) @@ -275,7 +275,7 @@ (values (if ready-only socks socket-or-sockets) to))))) (let* ((start (get-internal-real-time)) (sockets-ready 0)) - (dolist (x (wait-list sockets)) + (dolist (x (wait-list-waiters sockets)) (when (setf (state x) (if (and (stream-usocket-p x) (listen (socket-stream x))) @@ -293,7 +293,7 @@ (when (< elapsed timeout) (- timeout elapsed)))))) (values (if ready-only - (remove-if #'null (wait-list socket-or-sockets) :key #'state) + (remove-if #'null (wait-list-waiters socket-or-sockets) :key #'state) socket-or-sockets) to-result)))) @@ -301,13 +301,13 @@ ;; Data utility functions ;; -(defun integer-to-octready-et-buffer (integer buffer octets &key (start 0)) +(defun integer-to-octet-buffer (integer buffer octets &key (start 0)) (do ((b start (1+ b)) (i (ash (1- octets) 3) ;; * 8 (- i 8))) ((> 0 i) buffer) (setf (aref buffer b) - (ldb (byteready- 8 i) integer)))) + (ldb (byte 8 i) integer)))) (defun octet-buffer-to-integer (buffer octets &key (start 0)) (let ((integer 0)) @@ -423,7 +423,7 @@ (when hosts (elt hosts (random (length hosts)))))) - (defun host-toready--vector-quad (host) + (defun host-to-vector-quad (host) "Translate a host specification (vector quad, dotted quad or domain name) to a vector quad." (etypecase host @@ -470,7 +470,6 @@ ;; ;; (defun SOCKET-CONNECT (host port &key element-type) ..) ;; -ready-ready- (setf (documentation 'socket-connect 'function) "Connect to `host' on `port'. `host' is assumed to be a string or an IP address represented in vector notation, such as #(192 168 1 1). @@ -501,4 +500,4 @@ streams to be created by `socket-accept'. `reuseaddress' is supported for backward compatibility (but deprecated); when both `reuseaddress' and `reuse-address' have been specified, the latter takes precedence. -")ready-ready- +") From ehuelsmann at common-lisp.net Mon Jun 16 21:56:26 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Mon, 16 Jun 2008 17:56:26 -0400 (EDT) Subject: [usocket-cvs] r345 - usocket/branches/new-wfi/backend Message-ID: <20080616215626.1D12619@common-lisp.net> Author: ehuelsmann Date: Mon Jun 16 17:56:25 2008 New Revision: 345 Modified: usocket/branches/new-wfi/backend/allegro.lisp usocket/branches/new-wfi/backend/clisp.lisp usocket/branches/new-wfi/backend/cmucl.lisp usocket/branches/new-wfi/backend/openmcl.lisp Log: Follow-up commit, adjusting the wait-list slot names in the files. Modified: usocket/branches/new-wfi/backend/allegro.lisp ============================================================================== --- usocket/branches/new-wfi/backend/allegro.lisp (original) +++ usocket/branches/new-wfi/backend/allegro.lisp Mon Jun 16 17:56:25 2008 @@ -131,25 +131,25 @@ (declare (ignore wait-list))) (defun %add-waiter (wait-list waiter) - (push (socket waiter) (%wait wait-list))) + (push (socket waiter) (wait-list-%wait wait-list))) (defun %remove-waiter (wait-list waiter) - (setf (%wait wait-list) - (remove (socket waiter) (%wait wait-list)))) + (setf (wait-list-%wait wait-list) + (remove (socket waiter) (wait-list-%wait wait-list)))) (defun wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () (let ((active-internal-sockets (if timeout - (mp:wait-for-input-available (%wait wait-list) + (mp:wait-for-input-available (wait-list-%wait wait-list) :timeout timeout) - (mp:wait-for-input-available (%wait wait-list))))) + (mp:wait-for-input-available (wait-list-%wait wait-list))))) ;; this is quadratic, but hey, the active-internal-sockets ;; list is very short and it's only quadratic in the length of that one. ;; When I have more time I could recode it to something of linear ;; complexity. ;; [Same code is also used in openmcl.lisp] (dolist (x active-internal-sockets) - (setf (state (gethash x (wait-map wait-list))) + (setf (state (gethash x (wait-list-map wait-list))) :READ)) wait-list))) Modified: usocket/branches/new-wfi/backend/clisp.lisp ============================================================================== --- usocket/branches/new-wfi/backend/clisp.lisp (original) +++ usocket/branches/new-wfi/backend/clisp.lisp Mon Jun 16 17:56:25 2008 @@ -131,23 +131,23 @@ (declare (ignore wait-list))) (defun %add-waiter (wait-list waiter) - (push (cons (socket waiter) NIL) (%wait wait-list))) + (push (cons (socket waiter) NIL) (wait-list-%wait wait-list))) (defun %remove-waiter (wait-list waiter) - (setf (%wait wait-list) - (remove (socket waiter) (%wait wait-list) :key #'car))) + (setf (wait-list-%wait wait-list) + (remove (socket waiter) (wait-list-%wait wait-list) :key #'car))) (defmethod wait-for-input-internal (wait-list &key timeout) (with-mapped-conditions () (multiple-value-bind (secs musecs) (split-timeout (or timeout 1)) - (dolist (x (%wait wait-list)) + (dolist (x (wait-list-%wait wait-list)) (setf (cdr x) :INPUT)) (let* ((status-list (if timeout (socket:socket-status request-list secs musecs) (socket:socket-status request-list))) - (sockets (wait-list wait-list))) + (sockets (wait-list-waiters wait-list))) (do* ((x (pop sockets) (pop sockets)) (y (pop status-list) (pop status-list))) ((or (null sockets) (null status-list))) Modified: usocket/branches/new-wfi/backend/cmucl.lisp ============================================================================== --- usocket/branches/new-wfi/backend/cmucl.lisp (original) +++ usocket/branches/new-wfi/backend/cmucl.lisp Mon Jun 16 17:56:25 2008 @@ -175,7 +175,7 @@ (with-mapped-conditions () (alien:with-alien ((rfds (alien:struct unix:fd-set))) (unix:fd-zero rfds) - (dolist (socket (wait-list wait-list)) + (dolist (socket (wait-list-waiters wait-list)) (unix:fd-set (socket socket) rfds)) (multiple-value-bind (secs musecs) @@ -188,7 +188,7 @@ (when timeout secs) musecs) (if (<= 0 count) ;; process the result... - (dolist (x (wait-list wait-list)) + (dolist (x (wait-list-waiters wait-list)) (when (unix:fd-isset (socket x) rfds) (setf (state x) :READ))) (progn Modified: usocket/branches/new-wfi/backend/openmcl.lisp ============================================================================== --- usocket/branches/new-wfi/backend/openmcl.lisp (original) +++ usocket/branches/new-wfi/backend/openmcl.lisp Mon Jun 16 17:56:25 2008 @@ -153,7 +153,7 @@ (let* ((ticks-timeout (truncate (* (or timeout 1) ccl::*ticks-per-second*))) (active-internal-sockets - (input-available-p wait-list + (input-available-p (wait-list-waiters wait-list) (when timeout ticks-timeout)))) wait-list))) From ehuelsmann at common-lisp.net Fri Jun 20 22:21:33 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 18:21:33 -0400 (EDT) Subject: [usocket-cvs] r346 - usocket/branches/0.4.x/backend Message-ID: <20080620222133.E0CE116219@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 18:21:33 2008 New Revision: 346 Modified: usocket/branches/0.4.x/backend/lispworks.lisp Log: Backport c342 (mapcar and listen arguments). Modified: usocket/branches/0.4.x/backend/lispworks.lisp ============================================================================== --- usocket/branches/0.4.x/backend/lispworks.lisp (original) +++ usocket/branches/0.4.x/backend/lispworks.lisp Fri Jun 20 18:21:33 2008 @@ -157,7 +157,7 @@ (defun usocket-listen (usocket) (if (stream-usocket-p usocket) - (when (listen (socket usocket)) + (when (listen (socket-stream usocket)) usocket) (when (comm::socket-listen (socket usocket)) usocket))) @@ -174,15 +174,15 @@ ;; unfortunately, it's impossible to share code between ;; non-win32 and win32 platforms... ;; Can we have a sane -pref. complete [UDP!?]- API next time, please? - (mapcar #'mp:notice-fd sockets - :key #'os-socket-handle) + (dolist (x sockets) + (mp:notice-fd (os-socket-handle x))) (mp:process-wait-with-timeout "Waiting for a socket to become active" (truncate timeout) #'(lambda (socks) (some #'usocket-listen socks)) sockets) - (mapcar #'mp:unnotice-fd sockets - :key #'os-socket-handle) + (dolist (x sockets) + (mp:unnotice-fd (os-socket-handle x))) (remove nil (mapcar #'usocket-listen sockets)))) From ehuelsmann at common-lisp.net Fri Jun 20 22:41:17 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 18:41:17 -0400 (EDT) Subject: [usocket-cvs] r347 - usocket/branches/0.3.x/backend Message-ID: <20080620224117.1B06D7C059@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 18:41:17 2008 New Revision: 347 Modified: usocket/branches/0.3.x/backend/sbcl.lisp Log: Implement Juan's latest advice. Modified: usocket/branches/0.3.x/backend/sbcl.lisp ============================================================================== --- usocket/branches/0.3.x/backend/sbcl.lisp (original) +++ usocket/branches/0.3.x/backend/sbcl.lisp Fri Jun 20 18:41:17 2008 @@ -49,7 +49,7 @@ (defun get-host-name () (ffi:c-inline () () :object - "{ char *buf = GC_malloc(257); + "{ char *buf = cl_alloc_atomic(257); if (gethostname(buf,256) == 0) @(return) = make_simple_base_string(strndup(&buf,255)); From ehuelsmann at common-lisp.net Fri Jun 20 22:45:52 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 18:45:52 -0400 (EDT) Subject: [usocket-cvs] r348 - usocket/branches/0.4.x/backend Message-ID: <20080620224552.E642E7D1B5@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 18:45:52 2008 New Revision: 348 Modified: usocket/branches/0.4.x/backend/sbcl.lisp Log: Implement Juan's latest advice and backport c337 from Hans's branch. Modified: usocket/branches/0.4.x/backend/sbcl.lisp ============================================================================== --- usocket/branches/0.4.x/backend/sbcl.lisp (original) +++ usocket/branches/0.4.x/backend/sbcl.lisp Fri Jun 20 18:45:52 2008 @@ -67,7 +67,7 @@ (defun get-host-name () (ffi:c-inline () () :object - "{ char *buf = GC_malloc(256); + "{ char *buf = cl_alloc_atomic(256); if (gethostname(buf,256) == 0) @(return) = make_simple_base_string(buf); @@ -86,10 +86,10 @@ FD_ZERO(&rfds); while (CONSP(cur_fd)) { - int fd = fixint(cur_fd->cons.car); + int fd = fixint(CAR(cur_fd)); max_fd = (max_fd > fd) ? max_fd : fd; FD_SET(fd, &rfds); - cur_fd = cur_fd->cons.cdr; + cur_fd = CDR(cur_fd); } if (#1 != Cnil) { @@ -102,14 +102,14 @@ if (count == 0) @(return 0) = Cnil; @(return 1) = Cnil; - else if (count < 0) + } else if (count < 0) { /*###FIXME: We should be raising an error here... except, ofcourse in case of EINTR or EAGAIN */ @(return 0) = Cnil; @(return 1) = MAKE_INTEGER(errno); - else + } else { cl_object rv = Cnil; cur_fd = #0; @@ -152,6 +152,7 @@ . operation-not-permitted-error) (sb-bsd-sockets:protocol-not-supported-error . protocol-not-supported-error) + #-ecl (sb-bsd-sockets:unknown-protocol . protocol-not-supported-error) (sb-bsd-sockets:socket-type-not-supported-error @@ -161,6 +162,7 @@ (sb-bsd-sockets:socket-error . ,#'map-socket-error) ;; Nameservice errors: mapped to unknown-error + #-ecl #-ecl #-ecl (sb-bsd-sockets:no-recovery-error . ns-no-recovery-error) (sb-bsd-sockets:try-again-error . ns-try-again-condition) (sb-bsd-sockets:host-not-found-error . ns-host-not-found-error))) From ehuelsmann at common-lisp.net Fri Jun 20 23:26:29 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 19:26:29 -0400 (EDT) Subject: [usocket-cvs] r349 - usocket/branches/0.3.x/backend Message-ID: <20080620232629.1993C1F00E@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 19:26:28 2008 New Revision: 349 Modified: usocket/branches/0.3.x/backend/sbcl.lisp Log: Fix the fix (ecl coding hints). Modified: usocket/branches/0.3.x/backend/sbcl.lisp ============================================================================== --- usocket/branches/0.3.x/backend/sbcl.lisp (original) +++ usocket/branches/0.3.x/backend/sbcl.lisp Fri Jun 20 19:26:28 2008 @@ -52,7 +52,7 @@ "{ char *buf = cl_alloc_atomic(257); if (gethostname(buf,256) == 0) - @(return) = make_simple_base_string(strndup(&buf,255)); + @(return) = make_simple_base_string(buf); else @(return) = Cnil; }" :one-liner nil :side-effects nil))) From ehuelsmann at common-lisp.net Fri Jun 20 23:30:10 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 19:30:10 -0400 (EDT) Subject: [usocket-cvs] r350 - usocket/tags/0.3.6 Message-ID: <20080620233010.88CFA47005@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 19:30:09 2008 New Revision: 350 Added: usocket/tags/0.3.6/ - copied from r349, usocket/branches/0.3.x/ Modified: usocket/tags/0.3.6/usocket.asd Log: Create 0.3.6 tag. Modified: usocket/tags/0.3.6/usocket.asd ============================================================================== --- usocket/branches/0.3.x/usocket.asd (original) +++ usocket/tags/0.3.6/usocket.asd Fri Jun 20 19:30:09 2008 @@ -14,7 +14,7 @@ (defsystem usocket :name "usocket" :author "Erik Enge & Erik Huelsmann" - :version "0.3.5-dev" + :version "0.3.6" :licence "MIT" :description "Universal socket library for Common Lisp" :depends-on (:split-sequence From ehuelsmann at common-lisp.net Fri Jun 20 23:31:31 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 19:31:31 -0400 (EDT) Subject: [usocket-cvs] r351 - public_html/releases Message-ID: <20080620233131.364DA4D04E@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 19:31:29 2008 New Revision: 351 Added: public_html/releases/usocket-0.3.6.tar.gz (contents, props changed) Log: Publish usocket 0.3.6 (signing will do later). Added: public_html/releases/usocket-0.3.6.tar.gz ============================================================================== Binary file. No diff available. From ehuelsmann at common-lisp.net Fri Jun 20 23:33:17 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 19:33:17 -0400 (EDT) Subject: [usocket-cvs] r352 - public_html Message-ID: <20080620233317.3F6EB5F06E@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 19:33:15 2008 New Revision: 352 Modified: public_html/index.shtml Log: Document the release. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Fri Jun 20 19:33:15 2008 @@ -391,12 +391,11 @@ - - - + + + From ehuelsmann at common-lisp.net Sat Jun 21 00:06:03 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Fri, 20 Jun 2008 20:06:03 -0400 (EDT) Subject: [usocket-cvs] r353 - usocket/trunk/backend Message-ID: <20080621000603.C5FE67D1B5@common-lisp.net> Author: ehuelsmann Date: Fri Jun 20 20:06:02 2008 New Revision: 353 Modified: usocket/trunk/backend/allegro.lisp usocket/trunk/backend/armedbear.lisp usocket/trunk/backend/clisp.lisp usocket/trunk/backend/cmucl.lisp usocket/trunk/backend/lispworks.lisp usocket/trunk/backend/openmcl.lisp usocket/trunk/backend/sbcl.lisp usocket/trunk/backend/scl.lisp Log: Start supporting the timeout parameter for SOCKET-CONNECT. >From a patch by Hans Huebner, with additional supported platforms from me. Modified: usocket/trunk/backend/allegro.lisp ============================================================================== --- usocket/trunk/backend/allegro.lisp (original) +++ usocket/trunk/backend/allegro.lisp Fri Jun 20 20:06:02 2008 @@ -49,13 +49,18 @@ :text :binary)) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout) (let ((socket)) (setf socket (with-mapped-conditions (socket) - (socket:make-socket :remote-host (host-to-hostname host) - :remote-port port - :format (to-format element-type)))) + (if timeout + (mp:with-timeout (timeout nil) + (socket:make-socket :remote-host (host-to-hostname host) + :remote-port port + :format (to-format element-type))) + (socket:make-socket :remote-host (host-to-hostname host) + :remote-port port + :format (to-format element-type))))) (make-stream-socket :socket socket :stream socket))) Modified: usocket/trunk/backend/armedbear.lisp ============================================================================== --- usocket/trunk/backend/armedbear.lisp (original) +++ usocket/trunk/backend/armedbear.lisp Fri Jun 20 20:06:02 2008 @@ -185,7 +185,9 @@ (typecase condition (error (error 'unknown-error :socket socket :real-error condition)))) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout) + (when timeout + (warn "SOCKET-CONNECT timeout not supported in ABCL")) (let ((usock)) (with-mapped-conditions (usock) (let* ((sock-addr (jdi:jcoerce Modified: usocket/trunk/backend/clisp.lisp ============================================================================== --- usocket/trunk/backend/clisp.lisp (original) +++ usocket/trunk/backend/clisp.lisp Fri Jun 20 20:06:02 2008 @@ -55,14 +55,19 @@ (error usock-err :socket socket) (signal usock-err :socket socket))))))) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout) (let ((socket) (hostname (host-to-hostname host))) (with-mapped-conditions (socket) - (setf socket - (socket:socket-connect port hostname - :element-type element-type - :buffered t))) + (setf socket + (if timeout + (socket:socket-connect port hostname + :element-type element-type + :buffered t + :timeout timeout) + (socket:socket-connect port hostname + :element-type element-type + :buffered t)))) (make-stream-socket :socket socket :stream socket))) ;; the socket is a stream too Modified: usocket/trunk/backend/cmucl.lisp ============================================================================== --- usocket/trunk/backend/cmucl.lisp (original) +++ usocket/trunk/backend/cmucl.lisp Fri Jun 20 20:06:02 2008 @@ -50,7 +50,9 @@ :socket socket :condition condition)))) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout) + (when timeout + (warn "SOCKET-CONNECT timeout not supported in CMUCL")) (let* ((socket)) (setf socket (with-mapped-conditions (socket) Modified: usocket/trunk/backend/lispworks.lisp ============================================================================== --- usocket/trunk/backend/lispworks.lisp (original) +++ usocket/trunk/backend/lispworks.lisp Fri Jun 20 20:06:02 2008 @@ -73,7 +73,9 @@ (declare (ignore host port err-msg)) (raise-usock-err errno socket condition))))) -(defun socket-connect (host port &key (element-type 'base-char)) +(defun socket-connect (host port &key (element-type 'base-char) timeout) + (when timeout + (warn "SOCKET-CONNECT timeout not supported in Lispworks")) (let ((hostname (host-to-hostname host)) (stream)) (setf stream Modified: usocket/trunk/backend/openmcl.lisp ============================================================================== --- usocket/trunk/backend/openmcl.lisp (original) +++ usocket/trunk/backend/openmcl.lisp Fri Jun 20 20:06:02 2008 @@ -57,25 +57,30 @@ (defun handle-condition (condition &optional socket) (typecase condition (openmcl-socket:socket-error - (raise-error-from-id (openmcl-socket:socket-error-identifier condition) - socket condition)) + (raise-error-from-id (openmcl-socket:socket-error-identifier condition) + socket condition)) + (ccl:communication-deadline-expired + (error 'timeout-error :socket socket :real-error condition)) (ccl::socket-creation-error #| ugh! |# - (raise-error-from-id (ccl::socket-creation-error-identifier condition) - socket condition)))) + (raise-error-from-id (ccl::socket-creation-error-identifier condition) + socket condition)))) (defun to-format (element-type) (if (subtypep element-type 'character) :text :binary)) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout deadline) (with-mapped-conditions () - (let ((mcl-sock - (openmcl-socket:make-socket :remote-host (host-to-hostname host) - :remote-port port - :format (to-format element-type)))) - (openmcl-socket:socket-connect mcl-sock) - (make-stream-socket :stream mcl-sock :socket mcl-sock)))) + (let ((mcl-sock + (openmcl-socket:make-socket :remote-host (host-to-hostname host) + :remote-port port + :format (to-format element-type) + :deadline deadline + :connect-timeout (and timeout + (* timeout internal-time-units-per-second))))) + (openmcl-socket:socket-connect mcl-sock) + (make-stream-socket :stream mcl-sock :socket mcl-sock)))) (defun socket-listen (host port &key reuseaddress Modified: usocket/trunk/backend/sbcl.lisp ============================================================================== --- usocket/trunk/backend/sbcl.lisp (original) +++ usocket/trunk/backend/sbcl.lisp Fri Jun 20 20:06:02 2008 @@ -184,7 +184,10 @@ (signal usock-cond :socket socket)))))) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout deadline) + (declare (ignore deadline)) + (when timeout + (warn "SOCKET-CONNECT timeout not supported in SBCL")) (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket :type :stream :protocol :tcp)) (stream (sb-bsd-sockets:socket-make-stream socket Modified: usocket/trunk/backend/scl.lisp ============================================================================== --- usocket/trunk/backend/scl.lisp (original) +++ usocket/trunk/backend/scl.lisp Fri Jun 20 20:06:02 2008 @@ -28,7 +28,9 @@ :socket socket :condition condition)))) -(defun socket-connect (host port &key (element-type 'character)) +(defun socket-connect (host port &key (element-type 'character) timeout) + (when timeout + (warn "SOCKET-CONNECT timeout not supported in SCL")) (let* ((socket (with-mapped-conditions () (ext:connect-to-inet-socket (host-to-hbo host) port :kind :stream))) From ehuelsmann at common-lisp.net Thu Jun 26 21:30:49 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Thu, 26 Jun 2008 17:30:49 -0400 (EDT) Subject: [usocket-cvs] r354 - usocket/branches/0.3.x/backend Message-ID: <20080626213049.EFB06240D8@common-lisp.net> Author: ehuelsmann Date: Thu Jun 26 17:30:49 2008 New Revision: 354 Modified: usocket/branches/0.3.x/backend/openmcl.lisp Log: Fix OpenMCL (CCL) backend, directly on the branch, because this code doesn't exist on trunk any longer. Patch by: Chun Tian (binghe) (binghe.lisp at gmail.com) Modified: usocket/branches/0.3.x/backend/openmcl.lisp ============================================================================== --- usocket/branches/0.3.x/backend/openmcl.lisp (original) +++ usocket/branches/0.3.x/backend/openmcl.lisp Thu Jun 26 17:30:49 2008 @@ -37,15 +37,15 @@ (ccl::fd-zero infds) (ccl::fd-zero errfds) (dolist (sock sockets) - (ccl::fd-set (socket-os-fd sock infds)) - (ccl::fd-set (socket-os-fd sock errfds))) + (ccl::fd-set (openmcl-socket:socket-os-fd sock infds)) + (ccl::fd-set (openmcl-socket:socket-os-fd sock errfds))) (let* ((res (#_select - (1+ (apply #'max fds)) + (1+ (apply #'max infds)) infds (ccl::%null-ptr) errfds (if ticks-to-wait tv (ccl::%null-ptr))))) (when (> res 0) (remove-if #'(lambda (x) - (not (ccl::fd-is-set (socket-os-fd x) infds))) + (not (ccl::fd-is-set (openmcl-socket:socket-os-fd x) infds))) sockets)))))) (defun wait-for-input (sockets &optional ticks-to-wait) @@ -67,7 +67,7 @@ (raise-error-from-id (openmcl-socket:socket-error-identifier condition) socket condition)) (ccl::socket-creation-error #| ugh! |# - (raise-error-from-id (ccl::socket-creationg-error-identifier condition) + (raise-error-from-id (ccl::socket-creation-error-identifier condition) socket condition)) (error (error 'unknown-error :socket socket :real-error condition)) (condition (signal 'unknown-condition :real-condition condition)))) From ehuelsmann at common-lisp.net Sat Jun 28 07:57:38 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jun 2008 03:57:38 -0400 (EDT) Subject: [usocket-cvs] r355 - usocket/branches/0.3.x/backend Message-ID: <20080628075738.EEE81710E4@common-lisp.net> Author: ehuelsmann Date: Sat Jun 28 03:57:38 2008 New Revision: 355 Modified: usocket/branches/0.3.x/backend/openmcl.lisp Log: Followup to fix of OpenMCL backend. Patch by: Chun Tian (binghe.lisp at gmail.com) Modified: usocket/branches/0.3.x/backend/openmcl.lisp ============================================================================== --- usocket/branches/0.3.x/backend/openmcl.lisp (original) +++ usocket/branches/0.3.x/backend/openmcl.lisp Sat Jun 28 03:57:38 2008 @@ -37,8 +37,8 @@ (ccl::fd-zero infds) (ccl::fd-zero errfds) (dolist (sock sockets) - (ccl::fd-set (openmcl-socket:socket-os-fd sock infds)) - (ccl::fd-set (openmcl-socket:socket-os-fd sock errfds))) + (ccl::fd-set (openmcl-socket:socket-os-fd sock) infds) + (ccl::fd-set (openmcl-socket:socket-os-fd sock) errfds)) (let* ((res (#_select (1+ (apply #'max infds)) infds (ccl::%null-ptr) errfds From ehuelsmann at common-lisp.net Sat Jun 28 10:12:14 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jun 2008 06:12:14 -0400 (EDT) Subject: [usocket-cvs] r356 - usocket/tags/0.3.7 Message-ID: <20080628101214.81EB4640F4@common-lisp.net> Author: ehuelsmann Date: Sat Jun 28 06:12:13 2008 New Revision: 356 Added: usocket/tags/0.3.7/ - copied from r355, usocket/branches/0.3.x/ Modified: usocket/tags/0.3.7/usocket.asd Log: Create 0.3.7 tag. Modified: usocket/tags/0.3.7/usocket.asd ============================================================================== --- usocket/branches/0.3.x/usocket.asd (original) +++ usocket/tags/0.3.7/usocket.asd Sat Jun 28 06:12:13 2008 @@ -14,7 +14,7 @@ (defsystem usocket :name "usocket" :author "Erik Enge & Erik Huelsmann" - :version "0.3.5-dev" + :version "0.3.7" :licence "MIT" :description "Universal socket library for Common Lisp" :depends-on (:split-sequence From ehuelsmann at common-lisp.net Sat Jun 28 10:17:38 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jun 2008 06:17:38 -0400 (EDT) Subject: [usocket-cvs] r357 - in public_html: . releases Message-ID: <20080628101738.10E4F7A014@common-lisp.net> Author: ehuelsmann Date: Sat Jun 28 06:17:28 2008 New Revision: 357 Added: public_html/releases/usocket-0.3.7.tar.gz (contents, props changed) Modified: public_html/index.shtml Log: Add 0.3.7 release. Modified: public_html/index.shtml ============================================================================== --- public_html/index.shtml (original) +++ public_html/index.shtml Sat Jun 28 06:17:28 2008 @@ -391,6 +391,9 @@
Release history
DateReleaseSummary
Sep 18, 20070.3.5Implementation-dependent errors bleeding through, ECL get-host-name - memory allocation fix/win32 compat fix, CLISP compile warnings fixes, - SBCL compile warning/error fix, CLISP get-peer-name/get-local-name - fixes
Jun 21, 20080.3.6Code fixups based on advice from the ECL and OpenMCL maintainers. + New exported symbols: WITH-MAPPED-CONDITIONS, NS-CONDITION, + NS-ERROR, NS-UNKNOWN-ERROR and NS-UNKNOWN-CONDITION.
Jul 25, 2007 0.3.4 Fix clisp get-host-name, multiple ECL fixes.
+ + +
Release history
DateReleaseSummary
Jun 28, 20080.3.7Fix of OpenMCL (Closure CL) backend.
Jun 21, 2008 0.3.6 Code fixups based on advice from the ECL and OpenMCL maintainers. Added: public_html/releases/usocket-0.3.7.tar.gz ============================================================================== Binary file. No diff available. From ehuelsmann at common-lisp.net Sat Jun 28 10:18:18 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jun 2008 06:18:18 -0400 (EDT) Subject: [usocket-cvs] r358 - usocket/branches/0.3.x Message-ID: <20080628101818.4476912061@common-lisp.net> Author: ehuelsmann Date: Sat Jun 28 06:18:15 2008 New Revision: 358 Modified: usocket/branches/0.3.x/usocket.asd Log: Bump version number. Modified: usocket/branches/0.3.x/usocket.asd ============================================================================== --- usocket/branches/0.3.x/usocket.asd (original) +++ usocket/branches/0.3.x/usocket.asd Sat Jun 28 06:18:15 2008 @@ -14,7 +14,7 @@ (defsystem usocket :name "usocket" :author "Erik Enge & Erik Huelsmann" - :version "0.3.5-dev" + :version "0.3.8-dev" :licence "MIT" :description "Universal socket library for Common Lisp" :depends-on (:split-sequence From ehuelsmann at common-lisp.net Sat Jun 28 12:30:33 2008 From: ehuelsmann at common-lisp.net (ehuelsmann at common-lisp.net) Date: Sat, 28 Jun 2008 08:30:33 -0400 (EDT) Subject: [usocket-cvs] r359 - public_html/releases Message-ID: <20080628123033.682AD340BB@common-lisp.net> Author: ehuelsmann Date: Sat Jun 28 08:30:31 2008 New Revision: 359 Added: public_html/releases/usocket-0.3.6.tar.gz.asc public_html/releases/usocket-0.3.7.tar.gz.asc Log: Add signature files. Added: public_html/releases/usocket-0.3.6.tar.gz.asc ============================================================================== --- (empty file) +++ public_html/releases/usocket-0.3.6.tar.gz.asc Sat Jun 28 08:30:31 2008 @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQBIZi7yi5O0Epaz9TkRAulwAJ9g2dVsqbYf7f6FdOyR1iUkq9J2yACeIjyl +CDeMaYezgHhOpRFWWXoWeMM= +=Qa9v +-----END PGP SIGNATURE----- Added: public_html/releases/usocket-0.3.7.tar.gz.asc ============================================================================== --- (empty file) +++ public_html/releases/usocket-0.3.7.tar.gz.asc Sat Jun 28 08:30:31 2008 @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQBIZi8Hi5O0Epaz9TkRAsBRAJ9bLlrhPfjmolHIFwevuDQt+lOpdwCfVmfl +oDpQpvdjRQhraZfB88TrgS0= +=/Swp +-----END PGP SIGNATURE-----