Only setting the socketBufferSize in TcpTransport if the value is
greater than 0 as other values are illegal.
This commit is contained in:
Christopher L. Shannon (cshannon) 2016-02-08 16:11:55 +00:00
parent 386210fafe
commit 90726a60af
1 changed files with 7 additions and 2 deletions

View File

@ -453,8 +453,13 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
}
try {
//only positive values are legal
if (socketBufferSize > 0) {
sock.setReceiveBufferSize(socketBufferSize);
sock.setSendBufferSize(socketBufferSize);
} else {
LOG.warn("Socket buffer size was set to {}; Skipping this setting as the size must be a positive number.", socketBufferSize);
}
} catch (SocketException se) {
LOG.warn("Cannot set socket buffer size = " + socketBufferSize);
LOG.debug("Cannot set socket buffer size. Reason: " + se.getMessage() + ". This exception is ignored.", se);