[usocket-devel] more convenient :nodeay option - :if-supported

Anton Vodonosov avodonosov at yandex.ru
Fri Jan 20 22:23:31 UTC 2012


Hello.

Today socket-connect option :nodelay if specified accepts T or NIL. And whatever value is passed,
socket-connect signals the UNSUPPORTED exception on implementations where it is not
possible to control the socket no-delay property.

This dooms any usocket-using code which wishes to use :nodelay to be broken on
implementations where it is not implemented (e.g. CLISP, CMUCL, ...).

I think in most cases users would prefer "no delay if possible, otherwise just work as you can"
behavior. For example drakma. On the implementations where it is possible, it will have 
maximum performance by specifying no-delay. But on other implementations it is desirable
to work on usual socket.

To support this in backward-compatible fashion I propose to introduce another value
for the :nodelay option. :nodelay :if-supported. The meaning is obvious.

Please see the patch attached. It is tested (by changing drakma to use :nodelay :if-supported)
on all the implementations available to me: Allegro, CCL, CLISP, SBCL. 

Can't test on ECL and ABCL because of other obstacles (the last public release of ECL
can't comile babel, and ABCL can't load cffi).

Best regards,
- Anton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nodelay-patch.diff
Type: application/octet-stream
Size: 7676 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/usocket-devel/attachments/20120121/49174f66/attachment.obj>


More information about the usocket-devel mailing list