Package org.bitcoinj.net
Class NioServer
- java.lang.Object
-
- com.google.common.util.concurrent.AbstractExecutionThreadService
-
- org.bitcoinj.net.NioServer
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
public class NioServer extends com.google.common.util.concurrent.AbstractExecutionThreadService
Creates a simple server listener which listens for incoming client connections and uses aStreamConnection
to process data.
-
-
Constructor Summary
Constructors Constructor Description NioServer(StreamConnectionFactory connectionFactory, java.net.InetSocketAddress bindAddress)
Creates a new server which is capable of listening for incoming connections and processing client provided data usingStreamConnection
s created by the givenStreamConnectionFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
run()
void
triggerShutdown()
Invoked by the Execution service when it's time to stop.
-
-
-
Constructor Detail
-
NioServer
public NioServer(StreamConnectionFactory connectionFactory, java.net.InetSocketAddress bindAddress) throws java.io.IOException
Creates a new server which is capable of listening for incoming connections and processing client provided data usingStreamConnection
s created by the givenStreamConnectionFactory
- Throws:
java.io.IOException
- If there is an issue opening the server socket or binding fails for some reason
-
-
Method Detail
-
run
protected void run() throws java.lang.Exception
- Specified by:
run
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
java.lang.Exception
-
triggerShutdown
public void triggerShutdown()
Invoked by the Execution service when it's time to stop. Calling this method directly will NOT stop the service, callAbstractExecutionThreadService.stopAsync()
instead.- Overrides:
triggerShutdown
in classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
-