diff --git a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
--- a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
+++ b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPChannel.java
@@ -222,20 +222,34 @@
                 // choose protocol (single op if not reusable socket)
                 if (!conn.isReusable()) {
                     out.writeByte(TransportConstants.SingleOpProtocol);
                 } else {
                     out.writeByte(TransportConstants.StreamProtocol);
+
+                    int usableSoTimeout = 0;
+                    try {
+                        /*
+                         * If socket factory had set a non-zero timeout on its
+                         * own, then restore it instead of using the property-
+                         * configured value.
+                         */
+                        usableSoTimeout = sock.getSoTimeout();
+                        if (usableSoTimeout == 0) {
+                          usableSoTimeout = responseTimeout;
+                        }
+                        sock.setSoTimeout(usableSoTimeout);
+                    } catch (Exception e) {
+                        // if we fail to set this, ignore and proceed anyway
+                    }
                     out.flush();

                     /*
                      * Set socket read timeout to configured value for JRMP
                      * connection handshake; this also serves to guard against
                      * non-JRMP servers that do not respond (see 4322806).
                      */
-                    int originalSoTimeout = 0;
                     try {
-                        originalSoTimeout = sock.getSoTimeout();
                         sock.setSoTimeout(handshakeTimeout);
                     } catch (Exception e) {
                         // if we fail to set this, ignore and proceed anyway
                     }

@@ -279,18 +293,11 @@
                      * connection.  NOTE: this timeout, if configured to a
                      * finite duration, places an upper bound on the time
                      * that a remote method call is permitted to execute.
                      */
                     try {
-                        /*
-                         * If socket factory had set a non-zero timeout on its
-                         * own, then restore it instead of using the property-
-                         * configured value.
-                         */
-                        sock.setSoTimeout((originalSoTimeout != 0 ?
-                                           originalSoTimeout :
-                                           responseTimeout));
+                        sock.setSoTimeout(usableSoTimeout);
                     } catch (Exception e) {
                         // if we fail to set this, ignore and proceed anyway
                     }

                     out.flush();

