|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.kenmccrary.jtella.NetworkConnection
The NetworkConnection represents a connection to the GNUTella network. The connection consists of one or more socket connections to servants on the network.
The following is an example initiating a NetworkConnection.
NetworkConnection c = new NetworkConnection(host, port); c.addConnectionListener(new ConnectionListenerImpl()); c.start();
Constructor Summary | |
NetworkConnection(java.lang.String host,
int port)
Construct the Connection; |
Method Summary | |
void |
addConnectionListener(ConnectionListener listener)
Adds a listener interested in connection information |
SearchSession |
createSearchSession(MessageReceiver receiver)
Creates a session to conduct network searches |
SearchMonitorSession |
getSearchMonitorSession(MessageReceiver searchReceiver)
Get a search monitor session to monitor query requests flowing through this network connection, at this time only one SearchMonitorSession at a time is supported |
boolean |
isOnline()
Query if we are online with the network |
void |
removeConnectionListener(ConnectionListener listener)
Removes a listener interested in connection information |
void |
run()
Run the connection thread |
void |
start()
Starts the connection |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public NetworkConnection(java.lang.String host, int port) throws java.net.UnknownHostException, java.io.IOException
host
- can be a machine name or IP addressport
- port to useMethod Detail |
public void start()
public boolean isOnline()
public void addConnectionListener(ConnectionListener listener)
listener
- connection listenerpublic void removeConnectionListener(ConnectionListener listener)
listener
- connection listenerpublic SearchSession createSearchSession(MessageReceiver receiver)
receiver
- receiver for search responsespublic SearchMonitorSession getSearchMonitorSession(MessageReceiver searchReceiver)
SearchMonitorSession
at a time is supportedsearchReceiver
- message receiverpublic void run()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |