|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectasynctcp.ConnectionManager
public class ConnectionManager
A class allowing management of connections for an ASyncTCP
instance.
Method Summary | |
---|---|
java.util.List<IncomingConnection> |
getIncomingConnections()
Returns a list containing handles to all ASyncTCP connections established by a remote host. |
ASyncTCPListener |
getListener()
Retrieves the listener for this ASyncTCP instance. |
java.util.List<OutgoingConnection> |
getOutgoingConnections()
Returns a list containing handles to all ASyncTCP connections established by this host. |
int |
getPortNumber()
Returns the port number on which this ASyncTCP instance is listening for new incoming connections. |
OutgoingConnection |
openConnection(AddressPortPair app,
long timeout_ms)
Begins establishing a new ASyncTCP connection to a remote host at the specified IP address and port. |
ASyncTCPListener |
setListener(ASyncTCPListener asl)
Sets asl as the listener on this ASyncTCP instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public OutgoingConnection openConnection(AddressPortPair app, long timeout_ms)
app
- the IP address and port number of the remote hosttimeout_ms
- the maximum amount of time, in milliseconds, before it is assumed that
the connection attempt has failed
OutgoingConnection
objectpublic java.util.List<OutgoingConnection> getOutgoingConnections()
OutgoingConnection
objectspublic java.util.List<IncomingConnection> getIncomingConnections()
IncomingConnection
objects.public ASyncTCPListener getListener()
null
if there is no listenerpublic ASyncTCPListener setListener(ASyncTCPListener asl)
asl
as the listener on this ASyncTCP instance. The
listener can later be retrieved via the getListener
method. Only one listener may be set at a time; invoking this method
causes any previous listener to be discarded. The current listener may be
discarded by passing in null
.
asl
- the new listener for this ASyncTCP instance
public int getPortNumber()
-1
, then
this instance is not listening on any port, and manages only outgoing
connections.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |