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 a 
StreamConnection to
 process data.- 
Nested Class SummaryNested classes/interfaces inherited from interface com.google.common.util.concurrent.Servicecom.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
- 
Constructor SummaryConstructorsConstructorDescriptionNioServer(StreamConnectionFactory connectionFactory, InetSocketAddress bindAddress) Creates a new server which is capable of listening for incoming connections and processing client provided data usingStreamConnections created by the givenStreamConnectionFactory
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidrun()voidInvoked by the Execution service when it's time to stop.Methods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadServiceaddListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, shutDown, startAsync, startUp, state, stopAsync, toString
- 
Constructor Details- 
NioServerpublic NioServer(StreamConnectionFactory connectionFactory, InetSocketAddress bindAddress) throws IOException Creates a new server which is capable of listening for incoming connections and processing client provided data usingStreamConnections created by the givenStreamConnectionFactory- Throws:
- IOException- If there is an issue opening the server socket or binding fails for some reason
 
 
- 
- 
Method Details- 
run- Specified by:
- runin class- com.google.common.util.concurrent.AbstractExecutionThreadService
- Throws:
- Exception
 
- 
triggerShutdownpublic 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:
- triggerShutdownin class- com.google.common.util.concurrent.AbstractExecutionThreadService
 
 
-