|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.client.ClientListenerRunner
class ClientListenerRunner
Listen for connections on the specified port, and toss them onto the client manager's set of connections once they are established.
Field Summary | |
---|---|
protected boolean |
_bindAllInterfaces
|
protected RouterContext |
_context
|
protected boolean |
_listening
|
protected Log |
_log
|
protected ClientManager |
_manager
|
protected int |
_port
|
protected boolean |
_running
|
protected ServerSocket |
_socket
|
static String |
BIND_ALL_INTERFACES
|
protected static int |
CONNECT_TIMEOUT
give the i2cp client 5 seconds to show that they're really i2cp clients |
Constructor Summary | |
---|---|
ClientListenerRunner(RouterContext context,
ClientManager manager,
int port)
|
Method Summary | |
---|---|
protected ServerSocket |
getServerSocket()
Get a ServerSocket. |
boolean |
isListening()
|
void |
run()
|
protected void |
runConnection(Socket socket)
Handle the connection by passing it off to a ClientConnectionRunner |
protected void |
runServer()
Start up the socket listener, listens for connections, and fires those connections off via runConnection . |
void |
stopListening()
|
protected boolean |
validate(Socket socket)
Verify the first byte. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log _log
protected final RouterContext _context
protected final ClientManager _manager
protected ServerSocket _socket
protected final int _port
protected final boolean _bindAllInterfaces
protected volatile boolean _running
protected volatile boolean _listening
public static final String BIND_ALL_INTERFACES
protected static final int CONNECT_TIMEOUT
Constructor Detail |
---|
public ClientListenerRunner(RouterContext context, ClientManager manager, int port)
Method Detail |
---|
public boolean isListening()
protected ServerSocket getServerSocket() throws IOException
IOException
public void run()
run
in interface Runnable
protected void runServer()
runConnection
.
This only returns if the socket cannot be opened or there is a catastrophic
failure.
protected boolean validate(Socket socket)
protected void runConnection(Socket socket)
ClientConnectionRunner
public void stopListening()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |