|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.bitcoin.net.NioClient
public class NioClient
Creates a simple connection to a server using a StreamParser to process data.
| Constructor Summary | |
|---|---|
NioClient(SocketAddress serverAddress,
StreamParser parser,
int connectTimeoutMillis)
Creates a new client to the given server address using the given StreamParser to decode the data. |
|
| Method Summary | |
|---|---|
void |
closeConnection()
Closes the connection to the server, triggering the StreamParser.connectionClosed()
event on the network-handling thread where all callbacks occur. |
void |
writeBytes(byte[] message)
Writes the given bytes to the remote server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NioClient(SocketAddress serverAddress,
StreamParser parser,
int connectTimeoutMillis)
throws IOException
Creates a new client to the given server address using the given StreamParser to decode the data.
The given parser MUST be unique to this object. This does not block while waiting for the connection to
open, but will call either the StreamParser.connectionOpened() or
StreamParser.connectionClosed() callback on the created network event processing thread.
connectTimeoutMillis - The connect timeout set on the connection (in milliseconds). 0 is interpreted as no
timeout.
IOException| Method Detail |
|---|
public void closeConnection()
MessageWriteTargetStreamParser.connectionClosed()
event on the network-handling thread where all callbacks occur.
closeConnection in interface MessageWriteTarget
public void writeBytes(byte[] message)
throws IOException
MessageWriteTarget
writeBytes in interface MessageWriteTargetIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||