ASF Bugzilla – Attachment 20366 Details for
Bug 42689
no way to timeout new connect attempts for replication sockets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
diff to use Socket.connect with timeout parameter
DataSender.java.diff (text/plain), 1001 bytes, created by
Casey Lucas
on 2007-06-18 06:50:37 UTC
(
hide
)
Description:
diff to use Socket.connect with timeout parameter
Filename:
MIME Type:
Creator:
Casey Lucas
Created:
2007-06-18 06:50:37 UTC
Size:
1001 bytes
patch
obsolete
>Index: tcp/DataSender.java >=================================================================== >--- tcp/DataSender.java (revision 3540) >+++ tcp/DataSender.java (working copy) >@@ -19,7 +19,9 @@ > import java.io.IOException; > import java.io.OutputStream; > import java.net.InetAddress; >+import java.net.InetSocketAddress; > import java.net.Socket; >+import java.net.SocketAddress; > import java.net.SocketException; > > import org.apache.catalina.cluster.ClusterMessage; >@@ -713,7 +715,17 @@ > * @throws SocketException > */ > protected void createSocket() throws IOException, SocketException { >- socket = new Socket(getAddress(), getPort()); >+ SocketAddress sockAddr = new InetSocketAddress(getAddress(), getPort()); >+ socket = new Socket(); >+ int timeout = (int) getAckTimeout(); >+ if (timeout > 0) >+ { >+ socket.connect(sockAddr, timeout); >+ } >+ else >+ { >+ socket.connect(sockAddr); >+ } > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 42689
: 20366