net.i2p.client
Class I2PSimpleSession
java.lang.Object
net.i2p.client.I2PSessionImpl
net.i2p.client.I2PSessionImpl2
net.i2p.client.I2PSimpleSession
- All Implemented Interfaces:
- I2PSession, I2CPMessageReader.I2CPMessageEventListener
class I2PSimpleSession
- extends I2PSessionImpl2
Create a new session for doing naming and bandwidth queries only. Do not create a Destination.
Don't create a producer. Do not send/receive messages to other Destinations.
Cannot handle multiple simultaneous queries atm.
Could be expanded to ask the router other things.
- Author:
- zzz
Fields inherited from class net.i2p.client.I2PSessionImpl |
_availabilityNotifier, _availableMessages, _closed, _closing, _context, _handlerMap, _hostname, _log, _opening, _out, _portNum, _producer, _reader, _sessionListener, _socket, _writer, LISTEN_PORT |
Methods inherited from class net.i2p.client.I2PSessionImpl2 |
addMuxedSessionListener, addSessionListener, destroySession, getTimeout, receiveMessage, receiveStatus, reconnect, removeListener, sendBestEffort, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendNoEffort, shouldCompress |
Methods inherited from class net.i2p.client.I2PSessionImpl |
addNewMessage, dateUpdated, destroySession, disconnect, disconnected, getDecryptionKey, getLeaseSet, getMyDestination, getOpening, getOptions, getPrefix, getPrivateKey, getProducer, getSessionId, isClosed, lastActivity, loadConfig, messageReceived, propogateError, readError, reportAbuse, sendMessage, setLeaseSet, setOpening, setReduced, setSessionId, setSessionListener, shouldReconnect, toString, updateActivity |
I2PSimpleSession
public I2PSimpleSession(I2PAppContext context,
Properties options)
throws I2PSessionException
- Create a new session for doing naming and bandwidth queries only. Do not create a destination.
- Throws:
I2PSessionException
- if there is a problem
connect
public void connect()
throws I2PSessionException
- Connect to the router and establish a session. This call blocks until
a session is granted.
- Specified by:
connect
in interface I2PSession
- Overrides:
connect
in class I2PSessionImpl
- Throws:
I2PSessionException
- if there is a configuration error or the router is
not reachable
destReceived
void destReceived(Destination d)
- called by the message handler
bwReceived
void bwReceived(int[] i)
lookupDest
public Destination lookupDest(Hash h)
throws I2PSessionException
- Description copied from interface:
I2PSession
- Lookup up a Hash
- Specified by:
lookupDest
in interface I2PSession
- Overrides:
lookupDest
in class I2PSessionImpl
- Throws:
I2PSessionException
bandwidthLimits
public int[] bandwidthLimits()
throws I2PSessionException
- Description copied from interface:
I2PSession
- Get the current bandwidth limits
- Specified by:
bandwidthLimits
in interface I2PSession
- Overrides:
bandwidthLimits
in class I2PSessionImpl
- Throws:
I2PSessionException