Skip to content

Commit

Permalink
Added static TcpConnection.setDefaultHandshakeTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bjakke committed Aug 24, 2018
1 parent 26e8210 commit 4dbd0ba
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public ByteBuffer[] getPlaintexts() {
TcpConnectionLimits limits;
TcpQuotas quotas = TcpQuotas.DEFAULT_CLIENT_QUOTA;
EnumSet<OpcTcpSettings.Flag> flags = EnumSet.noneOf(OpcTcpSettings.Flag.class);
int handshakeTimeout = 60000;
int handshakeTimeout = defaultHandshakeTimeout;
SecurityConfiguration securityConfiguration;

/**
Expand Down Expand Up @@ -313,6 +313,24 @@ public static void setReceiveBufferSize(int receiveBufferSize) {
TcpConnection.receiveBufferSize = receiveBufferSize;
}

private static int defaultHandshakeTimeout = 60000;

/**
* See {@link #setDefaultHandshakeTimeout(int)}
*/
public static int getDefaultHandshakeTimeout() {
return defaultHandshakeTimeout;
}

/**
* Set the default timeout (in milliseconds) for making the initial connection handshake.
* Default value is 60000. It should be noted that the actual value used by
* the Operating System can be lower, usually the max timeout is around 20 seconds.
*/
public static void setDefaultHandshakeTimeout(int defaultHandshakeTimeout) {
TcpConnection.defaultHandshakeTimeout = defaultHandshakeTimeout;
}

private static int sendBufferSize = 0;

/**
Expand Down

0 comments on commit 4dbd0ba

Please sign in to comment.