Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.i2p.router.client
Class ClientListenerRunner

    java.lang.Object
      net.i2p.router.client.ClientListenerRunner

All Implemented Interfaces:
  Runnable

Direct Known Subclasses:
  InternalClientListenerRunner

    public class ClientListenerRunner

extends Object
implements Runnable

Listen for connections on the specified port, and toss them onto the client manager's set of connections once they are established.

Author:
  jrandom

Field Summary
`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`

Constructor Summary
`ClientListenerRunner(RouterContext context, ClientManager manager, int port)`

Method Summary
`int` | `getPort()`
`boolean` | `isListening()`
`void` | `run()`
`protected void` | `runConnection(Socket socket)` Handle the connection by passing it off to a `ClientConnectionRunner`
`void` | `runServer()` Start up the socket listener, listens for connections, and fires those connections off via `runConnection`.
`void` | `setPort(int port)`
`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

### _log

    protected Log _log

### _context

    protected RouterContext _context

### _manager

    protected ClientManager _manager

### _socket

    protected ServerSocket _socket

### _port

    protected int _port

### _running

    protected boolean _running

### _listening

    protected boolean _listening

### BIND_ALL_INTERFACES

    public static final String BIND_ALL_INTERFACES

See Also:
  Constant Field Values

Constructor Detail

### ClientListenerRunner

    public ClientListenerRunner(RouterContext context,
                                ClientManager manager,
                                int port)

Method Detail

### setPort

    public void setPort(int port)

### getPort

    public int getPort()

### isListening

    public boolean isListening()

### runServer

    public void runServer()

  Start up the socket listener, listens for connections, and fires those connections off via `runConnection`. This only returns if the socket cannot be opened or there is a catastrophic failure.

### validate

    protected boolean validate(Socket socket)

  Verify the first byte. The InternalSocket doesn't support SoTimeout, so use available() instead to prevent hanging.

### runConnection

    protected void runConnection(Socket socket)

  Handle the connection by passing it off to a `ClientConnectionRunner`

### stopListening

    public void stopListening()

### run

    public void run()

  Specified by:
    `run` in interface `Runnable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD