|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.common.util.concurrent.AbstractIdleService
com.google.bitcoin.net.BlockingClientManager
public class BlockingClientManager
A thin wrapper around a set of BlockingClients.
Generally, using NioClient and NioClientManager should be preferred over BlockingClient
and BlockingClientManager as they scale significantly better, unless you wish to connect over a proxy or use
some other network settings that cannot be set using NIO.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service |
|---|
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State |
| Constructor Summary | |
|---|---|
BlockingClientManager()
|
|
BlockingClientManager(SocketFactory socketFactory)
Creates a blocking client manager that will obtain sockets from the given factory. |
|
| Method Summary | |
|---|---|
void |
closeConnections(int n)
Closes n peer connections |
int |
getConnectedClientCount()
Gets the number of connected peers |
void |
openConnection(SocketAddress serverAddress,
StreamParser parser)
Creates a new connection to the given address, with the given parser used to handle incoming data. |
void |
setConnectTimeoutMillis(int connectTimeoutMillis)
Sets the number of milliseconds to wait before giving up on a connect attempt |
protected void |
shutDown()
|
protected void |
startUp()
|
| Methods inherited from class com.google.common.util.concurrent.AbstractIdleService |
|---|
addListener, executor, isRunning, start, startAndWait, state, stop, stopAndWait, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.common.util.concurrent.Service |
|---|
addListener, isRunning, start, startAndWait, state, stop, stopAndWait |
| Constructor Detail |
|---|
public BlockingClientManager()
public BlockingClientManager(SocketFactory socketFactory)
| Method Detail |
|---|
public void openConnection(SocketAddress serverAddress,
StreamParser parser)
ClientConnectionManager
openConnection in interface ClientConnectionManagerpublic void setConnectTimeoutMillis(int connectTimeoutMillis)
protected void startUp()
throws Exception
startUp in class com.google.common.util.concurrent.AbstractIdleServiceException
protected void shutDown()
throws Exception
shutDown in class com.google.common.util.concurrent.AbstractIdleServiceExceptionpublic int getConnectedClientCount()
ClientConnectionManager
getConnectedClientCount in interface ClientConnectionManagerpublic void closeConnections(int n)
ClientConnectionManager
closeConnections in interface ClientConnectionManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||