org.nhindirect.dns
Class SocketServerSettings

java.lang.Object
  extended by org.nhindirect.dns.SocketServerSettings
Direct Known Subclasses:
DNSServerSettings

public class SocketServerSettings
extends Object

Tuning parameters for the DNS server socket connections. Tuning parameters are important to maximize the performance of the DNS server or to prevent the server machine from becoming over loaded.

Since:
1.0
Author:
Greg Meyer, Umesh Madan, Chris Lomonico

Constructor Summary
SocketServerSettings()
          Creates a default set of socket parameters.
 
Method Summary
 int getMaxActiveRequests()
          Gets the maximum number of concurrent requests that can be processed by the server at any give time.
 int getMaxConnectionBacklog()
          Gets the maximum number of connections that are in the IP socket accept backlog.
 int getMaxOutstandingAccepts()
          Gets the maximum number of requests that can be accepted by the server, but not yet committed to a processing thread.
 int getReadBufferSize()
          Gets the maximum size request buffer size in bytes.
 int getReceiveTimeout()
          Gets the socket timeout in milliseconds for receiving or reading request.
 int getSendTimeout()
          Gets the socket timeout in milliseconds for sending responses.
 int getSocketCloseTimeout()
          Gets the timeout in milliseconds for closing a socket connection.
 void setMaxActiveRequests(int maxActiveRequests)
          Sets the maximum number of concurrent requests that can be processed by the server at any give time.
 void setMaxConnectionBacklog(int maxConnectionBacklog)
          Sets the maximum number of connections that are in the IP socket accept backlog.
 void setMaxOutstandingAccepts(int maxOutstandingAccepts)
          Sets the maximum number of requests that can be accepted by the server, but not yet committed to a processing thread.
 void setReadBufferSize(int readBufferSize)
          Sets the maximum size request buffer size in bytes.
 void setReceiveTimeout(int receiveTimeout)
          Sets the socket timeout in milliseconds for receiving or reading request.
 void setSendTimeout(int sendTimeout)
          Sets the socket timeout in milliseconds for sending responses.
 void setSocketCloseTimeout(int socketCloseTimeout)
          Sets the timeout in milliseconds for closing a socket connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketServerSettings

public SocketServerSettings()
Creates a default set of socket parameters.

Method Detail

getMaxOutstandingAccepts

public int getMaxOutstandingAccepts()
Gets the maximum number of requests that can be accepted by the server, but not yet committed to a processing thread. Setting this value to high may result in DNS clients timing out due to outstanding requests waiting to long for a processing thread. The default is 16 requests.

Returns:
The maximum number of requests that can be excepted by the server, but not yet committed to a processing thread.

setMaxOutstandingAccepts

public void setMaxOutstandingAccepts(int maxOutstandingAccepts)
Sets the maximum number of requests that can be accepted by the server, but not yet committed to a processing thread.

Parameters:
maxOutstandingAccepts - The maximum number of requests that can be accepted by the server, but not yet committed to a processing thread.

getMaxActiveRequests

public int getMaxActiveRequests()
Gets the maximum number of concurrent requests that can be processed by the server at any give time. Setting this value to high may result in overloading the system. Setting this value to low can limit throughput. The default 64.

Returns:
The maximum number of concurrent requests that can be processed by the server at any give time.

setMaxActiveRequests

public void setMaxActiveRequests(int maxActiveRequests)
Sets the maximum number of concurrent requests that can be processed by the server at any give time.

Parameters:
maxActiveRequests - The maximum number of concurrent requests that can be processed by the server at any give time.

getMaxConnectionBacklog

public int getMaxConnectionBacklog()
Gets the maximum number of connections that are in the IP socket accept backlog. Socket backlog is only relevant for TCP session based connections. Setting this value to high can overload the IP stack or result in DNS client timeouts. The default value is 64.

Returns:
The maximum number of connections that are in the IP socket accept backlog.

setMaxConnectionBacklog

public void setMaxConnectionBacklog(int maxConnectionBacklog)
Sets the maximum number of connections that are in the IP socket accept backlog.

Parameters:
maxConnectionBacklog - The maximum number of connections that are in the IP socket accept backlog.

getReadBufferSize

public int getReadBufferSize()
Gets the maximum size request buffer size in bytes. The default value is 1024 bytes.

Returns:
The maximum size request buffer size in bytes.

setReadBufferSize

public void setReadBufferSize(int readBufferSize)
Sets the maximum size request buffer size in bytes.

Parameters:
readBufferSize - The maximum size request buffer size in bytes.

getSendTimeout

public int getSendTimeout()
Gets the socket timeout in milliseconds for sending responses. Setting this value to high can result in performance degradation if multiple clients abandon their sessions. Setting this value to low can result in clients not receiving responses in high latency environments. The default value is 5000 milliseconds.

Returns:
The socket timeout in milliseconds for sending responses

setSendTimeout

public void setSendTimeout(int sendTimeout)
Sets the socket timeout in milliseconds for sending responses.

Parameters:
sendTimeout - Sets the socket timeout in milliseconds for sending responses.

getReceiveTimeout

public int getReceiveTimeout()
Gets the socket timeout in milliseconds for receiving or reading request. Setting this value to high can result in performance degradation if multiple clients abandon their sessions. Setting this value to low can result in the server not fully reading request data in high latency environments. The default value is 5000 milliseconds.

Returns:
The socket timeout in milliseconds for receiving or reading requests.

setReceiveTimeout

public void setReceiveTimeout(int receiveTimeout)
Sets the socket timeout in milliseconds for receiving or reading request.

Parameters:
receiveTimeout - The socket timeout in milliseconds for receiving or reading request.

getSocketCloseTimeout

public int getSocketCloseTimeout()
Gets the timeout in milliseconds for closing a socket connection. The default value is 5000 milliseconds.

Returns:
The timeout in milliseconds for closing a socket connection.

setSocketCloseTimeout

public void setSocketCloseTimeout(int socketCloseTimeout)
Sets the timeout in milliseconds for closing a socket connection. The default value is 5000 milliseconds.

Parameters:
socketCloseTimeout - The timeout in milliseconds for closing a socket connection.


Copyright © 2010-2015 The Direct Project. All Rights Reserved.