Index: usocket.lisp
===================================================================
--- usocket.lisp	(revision 678)
+++ usocket.lisp	(working copy)
@@ -529,7 +529,7 @@
 
 ;; Documentation for the function
 ;;
-;; (defun SOCKET-CONNECT (host port &key element-type) ..)
+;; (defun SOCKET-CONNECT (host port &key element-type nodelay some-other-keys...) ..)
 ;;
 (setf (documentation 'socket-connect 'function)
       "Connect to `host' on `port'.  `host' is assumed to be a string or
@@ -539,6 +539,20 @@
 `element-type' specifies the element type to use when constructing the
 stream associated with the socket.  The default is 'character.
 
+`nodelay' Allows to disable/enable Nagle's algorithm (http://en.wikipedia.org/wiki/Nagle%27s_algorithm).
+If this parameter is omitted, the behaviour is inherited form the 
+CL implementation (in most cases the Nagle's algorithm is 
+enabled by default, but for example in ACL it is disabled).
+If the parmeter is specified, one of these three values is possible: 
+  T - Disable the Nagle's algorithm; signals an UNSUPPORTED
+      condition if the implementation does not support explicit 
+      manipulation with that option.
+  NIL - Leave the Nagle's algorithm enabled on the socket;
+      signals an UNSUPPORTED condition if the implementation does 
+      not support explicit manipulation with that option.
+  :IF-SUPPORTED - Disables the Nagle's algorithm if the implementation
+      allows this, otherwises just ignore this option.
+
 Returns a usocket object.")
 
 ;; Documentation for the function
Index: backend/clisp.lisp
===================================================================
--- backend/clisp.lisp	(revision 678)
+++ backend/clisp.lisp	(working copy)
@@ -116,10 +116,11 @@
 (defun socket-connect (host port &key (protocol :stream) (element-type 'character)
                        timeout deadline (nodelay t nodelay-specified)
                        local-host local-port)
-  (declare (ignore nodelay)
-	   (ignorable timeout local-host local-port))
+  (declare (ignorable timeout local-host local-port))
   (when deadline (unsupported 'deadline 'socket-connect))
-  (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+  (when (and nodelay-specified 
+             (not (eq nodelay :if-supported)))
+    (unsupported 'nodelay 'socket-connect))
   (case protocol
     (:stream
      (let ((socket)
Index: backend/mcl.lisp
===================================================================
--- backend/mcl.lisp	(revision 678)
+++ backend/mcl.lisp	(working copy)
@@ -73,6 +73,8 @@
 
 (defun socket-connect (host port &key (element-type 'character) timeout deadline nodelay 
                             local-host local-port (protocol :stream))
+  (when (eq nodelay :if-supported)
+    (setf nodelay t))
   (when (eq protocol :datagram)
     (unsupported '(protocol :datagram) 'socket-connect))
   (with-mapped-conditions ()
Index: backend/lispworks.lisp
===================================================================
--- backend/lispworks.lisp	(revision 678)
+++ backend/lispworks.lisp	(working copy)
@@ -253,7 +253,6 @@
 (defun socket-connect (host port &key (protocol :stream) (element-type 'base-char)
                        timeout deadline (nodelay t nodelay-specified)
                        local-host (local-port #+win32 *auto-port* #-win32 nil))
-  (declare (ignorable nodelay))
 
   ;; What's the meaning of this keyword?
   (when deadline
@@ -264,7 +263,8 @@
     (unsupported 'timeout 'socket-connect :minimum "LispWorks 4.4.5"))
 
   #+(or lispworks4 lispworks5.0) ; < 5.1
-  (when nodelay-specified
+  (when (and nodelay-specified 
+             (not (eq nodelay :if-supported)))
     (unsupported 'nodelay 'socket-connect :minimum "LispWorks 5.1"))
 
   #+lispworks4 #+lispworks4
Index: backend/openmcl.lisp
===================================================================
--- backend/openmcl.lisp	(revision 678)
+++ backend/openmcl.lisp	(working copy)
@@ -85,6 +85,8 @@
 (defun socket-connect (host port &key (protocol :stream) (element-type 'character)
 		       timeout deadline nodelay
                        local-host local-port)
+  (when (eq nodelay :if-supported)
+    (setf nodelay t))
   (with-mapped-conditions ()
     (ecase protocol
       (:stream
Index: backend/abcl.lisp
===================================================================
--- backend/abcl.lisp	(revision 678)
+++ backend/abcl.lisp	(working copy)
@@ -212,7 +212,8 @@
 	 (setq stream (ext:get-socket-stream socket :element-type element-type)
 	       usocket (make-stream-socket :stream stream :socket socket))
 	 (when nodelay-supplied-p
-	   (jcall $@setTcpNoDelay/1 socket (if nodelay +java-true+ +java-false+)))
+	   (jcall $@setTcpNoDelay/1 socket (if nodelay ;; both t and :if-supported mean +java-true+
+                                           +java-true+ +java-false+)))
 	 (when timeout
 	   (jcall $@setSoTimeout/Socket/1 socket (truncate (* 1000 timeout))))))
       (:datagram ; UDP
Index: backend/scl.lisp
===================================================================
--- backend/scl.lisp	(revision 678)
+++ backend/scl.lisp	(working copy)
@@ -34,8 +34,9 @@
 		       (local-port nil local-port-p)
 		       &aux
 		       (patch-udp-p (fboundp 'ext::inet-socket-send-to)))
-  (declare (ignore nodelay))
-  (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+  (when (and nodelay-specified 
+             (not (eq nodelay :if-supported)))
+    (unsupported 'nodelay 'socket-connect))
   (when deadline (unsupported 'deadline 'socket-connect))
   (when timeout (unsupported 'timeout 'socket-connect))
   (when (and local-host-p (not patch-udp-p))
Index: backend/cmucl.lisp
===================================================================
--- backend/cmucl.lisp	(revision 678)
+++ backend/cmucl.lisp	(working copy)
@@ -56,10 +56,11 @@
 		       (local-port nil local-port-p)
 		       &aux
 		       (local-bind-p (fboundp 'ext::bind-inet-socket)))
-  (declare (ignore nodelay))
   (when timeout (unsupported 'timeout 'socket-connect))
   (when deadline (unsupported 'deadline 'socket-connect))
-  (when nodelay-specified (unsupported 'nodelay 'socket-connect))
+  (when (and nodelay-specified 
+             (not (eq nodelay :if-supported)))
+    (unsupported 'nodelay 'socket-connect))
   (when (and local-host-p (not local-bind-p))
      (unsupported 'local-host 'socket-connect :minimum "Snapshot 2008-08 (19E)"))
   (when (and local-port-p (not local-bind-p))
Index: backend/sbcl.lisp
===================================================================
--- backend/sbcl.lisp	(revision 678)
+++ backend/sbcl.lisp	(working copy)
@@ -261,8 +261,11 @@
              ;; package today. There's no guarantee the functions
              ;; we need are available, but we can make sure not to
              ;; call them if they aren't
+             (not (eq nodelay :if-supported))
              (not sockopt-tcp-nodelay-p))
     (unsupported 'nodelay 'socket-connect))
+  (when (eq nodelay :if-supported)
+    (setf nodelay t))
 
   (let ((socket (make-instance 'sb-bsd-sockets:inet-socket
                                :type protocol
Index: backend/allegro.lisp
===================================================================
--- backend/allegro.lisp	(revision 678)
+++ backend/allegro.lisp	(working copy)
@@ -55,6 +55,8 @@
                        local-host local-port)
   (when timeout (unsupported 'timeout 'socket-connect))
   (when deadline (unsupported 'deadline 'socket-connect))
+  (when (eq nodelay :if-supported)
+    (setf nodelay t))
 
   (let ((socket))
     (setf socket
