public abstract class DNSSocketServer extends Object implements DNSSocketServerMBean
| Constructor and Description |
|---|
DNSSocketServer(DNSServerSettings settings,
DNSResponder responsder)
Creates a socket server.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
createServerSocket()
Creates and initializes the socket implementation that will accept incoming requests.
|
abstract Runnable |
getDNSRequestTask(Object s)
Gets the Runnable task that will process a DNS request.
|
Long |
getRejectedRequestCount()
Gets the number of requests that were rejected by the server due to being to busy.
|
Long |
getResourceRequestCount()
Gets the number of DNS requests received by the server.
|
String |
getResourceRequestLoad()
Gets the request load of the server.
|
abstract Runnable |
getSocketAcceptTask()
Gets the Runnable task that will be responsible for accepting connections.
|
Long |
getUptime()
Gets the time in milliseconds that the server has been running since its last start.
|
void |
start()
Starts the socket server and initializes the dispatch threads.
|
void |
stop()
Shuts down the socket server and terminates the server from accepting additional requests.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetErrorRequestCount, getMissedRequestCount, getSuccessfulRequestCountpublic DNSSocketServer(DNSServerSettings settings, DNSResponder responsder) throws DNSException
start() method is called.settings - The server settings. The settings contain specific IP and socket configuration parameters.responsder - The DNS responder that will handle lookups.DNSExceptionpublic void start()
throws DNSException
DNSExceptionpublic void stop()
throws DNSException
DNSExceptionpublic abstract void createServerSocket()
throws DNSException
DNSExceptionpublic abstract Runnable getSocketAcceptTask()
public abstract Runnable getDNSRequestTask(Object s)
s - An arbitrary parameter passed to the Runnable task. This parameter generally contain the DNS request information.
This may be the TCP socket from the accept() server socket call or a UDP datagram packet.public Long getUptime()
getUptime in interface DNSSocketServerMBeanpublic Long getRejectedRequestCount()
getRejectedRequestCount in interface DNSSocketServerMBeanpublic Long getResourceRequestCount()
getResourceRequestCount in interface DNSSocketServerMBeanpublic String getResourceRequestLoad()
getResourceRequestLoad in interface DNSSocketServerMBeanCopyright © 2010-2015 The Direct Project. All Rights Reserved.