public static class NIOServerCnxn.Factory
extends java.lang.Thread
Constructor and Description |
---|
NIOServerCnxn.Factory(java.net.InetSocketAddress addr)
Construct a new server connection factory which will accept an unlimited number
of concurrent connections from each client (up to the file descriptor
limits of the operating system).
|
NIOServerCnxn.Factory(java.net.InetSocketAddress addr,
int maxcc)
Constructs a new server connection factory where the number of concurrent connections
from a single IP address is limited to maxcc (or unlimited if 0).
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all the connections in the selector.
|
protected NIOServerCnxn |
createConnection(java.nio.channels.SocketChannel sock,
java.nio.channels.SelectionKey sk) |
java.net.InetSocketAddress |
getLocalAddress() |
int |
getLocalPort() |
int |
getMaxClientCnxns() |
ZooKeeperServer |
getZooKeeperServer() |
void |
run() |
void |
setZooKeeperServer(ZooKeeperServer zks) |
void |
shutdown() |
void |
start() |
void |
startup(ZooKeeperServer zks) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public NIOServerCnxn.Factory(java.net.InetSocketAddress addr) throws java.io.IOException
port
- java.io.IOException
public NIOServerCnxn.Factory(java.net.InetSocketAddress addr, int maxcc) throws java.io.IOException
port
- - the port to listen on for connections.maxcc
- - the number of concurrent connections allowed from a single client.java.io.IOException
public void start()
start
in class java.lang.Thread
public void startup(ZooKeeperServer zks) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void setZooKeeperServer(ZooKeeperServer zks)
public ZooKeeperServer getZooKeeperServer()
public java.net.InetSocketAddress getLocalAddress()
public int getLocalPort()
public int getMaxClientCnxns()
protected NIOServerCnxn createConnection(java.nio.channels.SocketChannel sock, java.nio.channels.SelectionKey sk) throws java.io.IOException
java.io.IOException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void clear()
public void shutdown()
Copyright © 2016 The Apache Software Foundation