class SubSession extends I2PSessionMuxedImpl
I2PSessionMuxedImpl.MuxedAvailabilityNotifierI2PSessionImpl.AvailabilityNotifier, I2PSessionImpl.StateI2PSession.TunnelPair_noEffort, _sendingStates, _sendMessageNonce_availabilityNotifier, _availableMessages, _bwLimits, _bwReceivedLock, _context, _handlerMap, _hostname, _leaseSet, _leaseSetWait, _log, _pendingLookups, _portNum, _producer, _queue, _reader, _sessionListener, _socket, _state, _stateLock, _transientSigningPublicKey, _tunnelStatusListeners, _writer, CACHE_MAX_SIZE, DUMMY_SESSION, LISTEN_PORT, PROP_DOMAIN_SOCKETPORT_ANY, PORT_UNSPECIFIED, PROTO_ANY, PROTO_DATAGRAM, PROTO_DATAGRAM_RAW, PROTO_DATAGRAM2, PROTO_DATAGRAM3, PROTO_STREAMING, PROTO_UNSPECIFIED| Constructor and Description |
|---|
SubSession(I2PSession primary,
InputStream destKeyStream,
Properties options)Must be a I2PSessionMuxedImpl. |
| Modifier and Type | Method and Description |
|---|---|
I2PSession | addSubsession(InputStream destKeyStream,
Properties opts)Unsupported in a subsession. |
int[] | bandwidthLimits()This won't be called, as the reply does not contain a session ID, so
it won't be routed back to us |
(package private) void | bwReceived(int[] i)Called by the message handler. |
void | connect()Connect to the router and establish a session. |
(package private) void | destLookupFailed(Hash h)Called by the message handler
on reception of DestReplyMessage
This will never happen, as the dest reply message does not contain a session ID. |
(package private) void | destLookupFailed(long nonce,
int code)Called by the message handler
on reception of HostReplyMessage |
(package private) void | destReceived(Destination d)Called by the message handler
on reception of DestReplyMessage
This will never happen, as the dest reply message does not contain a session ID. |
(package private) void | destReceived(long nonce,
Destination d)Called by the message handler
on reception of HostReplyMessage |
void | destroySession()Tear down the session, and do NOT reconnect. |
protected void | disconnect()Will interrupt a connect in progress. |
Properties | getPrimaryOptions()Primary options. |
List<I2PSession> | getSubsessions()Unsupported in a subsession. |
boolean | isClosed()Has the session been closed (or not yet connected)?
False when open and during transitions. |
long | lastActivity()Time of last session activity in milliseconds. |
Destination | lookupDest(Hash h)Blocking. |
Destination | lookupDest(Hash h,
long maxWait)Blocking. |
Destination | lookupDest(String name)Ask the router to lookup a Destination by host name. |
Destination | lookupDest(String name,
long maxWait)Ask the router to lookup a Destination by host name. |
(package private) void | propagateError(String msg,
Throwable error)Pass off the error to the listener
Misspelled, oh well. |
protected boolean | reconnect()Called whenever we want to reconnect (used only in the superclass). |
void | removeSubsession(I2PSession session)Unsupported in a subsession. |
(package private) void | sendMessage_unchecked(I2CPMessage message)Deliver an I2CP message to the router. |
(package private) void | sendMessage(I2CPMessage message)Deliver an I2CP message to the router
May block for several seconds if the write queue to the router is full |
void | setReduced()Mark the session as reduced |
protected void | updateActivity()Update the last activity timestamp |
void | updateOptions(Properties options)Does nothing for now |
addMuxedSessionListener, addNewMessage, addSessionListener, removeListener, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, setSessionListeneraddTunnelStatusListener, destroySession, getCurrentTunnelPair, getTimeout, notifyPoolShuttingDown, notifyTunnelFailed, notifyTunnelRemoved, rebuildTunnels, receiveMessage, receiveStatus, removeTunnelStatusListener, sendBestEffort, sendBestEffort, sendMessage, sendMessage, sendMessage, sendNoEffort, setCurrentTunnelPair, shouldCompress, startVerifyUsage, switchToNewTunnelchangeState, clearCache, dateUpdated, disconnected, getContext, getFastReceive, getHandlerMap, getLastLS2SignTime, getLeaseSet, getMyDestination, getName, getOfflineExpiration, getOfflineSignature, getOptions, getPrefix, getPrivateKey, getProducer, getRouterVersion, getSessionId, getTransientSigningPublicKey, isOffline, lookupDest, lookupDest, lookupDest2, messageReceived, readError, reportAbuse, sendBlindingInfo, setLastLS2SignTime, setLeaseSet, setSessionId, shouldReconnect, supportsLS2, toString, verifyOpen, waitForDateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDecryptionKeypublic SubSession(I2PSession primary, InputStream destKeyStream, Properties options) throws I2PSessionException
primary - must be a I2PSessionMuxedImpldestKeyStream - location from which to read keysoptions - session optionsI2PSessionExceptionpublic I2PSession addSubsession(InputStream destKeyStream, Properties opts) throws I2PSessionException
addSubsession in interface I2PSessionaddSubsession in class I2PSessionImpldestKeyStream - null for transient, if non-null must have same encryption keys as primary session
and different signing keysopts - subsession options if any, may be nullUnsupportedOperationException - alwaysI2PSessionException - on errorpublic int[] bandwidthLimits()
throws I2PSessionExceptionbandwidthLimits in interface I2PSessionbandwidthLimits in class I2PSessionImplI2PSessionException - on errorvoid bwReceived(int[] i)
bwReceived in class I2PSessionImpli - the bandwidth limitspublic void connect()
throws I2PSessionExceptionconnect in interface I2PSessionconnect in class I2PSessionImplI2PSessionException - if there is a configuration error or the router is
not reachablevoid destLookupFailed(Hash h)
destLookupFailed in class I2PSessionImplh - non-nullvoid destLookupFailed(long nonce,
int code)destLookupFailed in class I2PSessionImplnonce - the lookup noncecode - the failure codevoid destReceived(Destination d)
destReceived in class I2PSessionImpld - non-nullvoid destReceived(long nonce,
Destination d)destReceived in class I2PSessionImpld - non-nullnonce - the lookup noncepublic void destroySession()
destroySession in interface I2PSessiondestroySession in class I2PSessionImplprotected void disconnect()
disconnect in class I2PSessionImplpublic Properties getPrimaryOptions()
public List<I2PSession> getSubsessions()
getSubsessions in interface I2PSessiongetSubsessions in class I2PSessionImplpublic boolean isClosed()
isClosed in interface I2PSessionisClosed in class I2PSessionImplpublic long lastActivity()
I2PSessionImpllastActivity in class I2PSessionImplpublic Destination lookupDest(Hash h) throws I2PSessionException
lookupDest in interface I2PSessionlookupDest in class I2PSessionImplh - the hash to look upI2PSessionException - on errorpublic Destination lookupDest(Hash h, long maxWait) throws I2PSessionException
lookupDest in interface I2PSessionlookupDest in class I2PSessionImplmaxWait - msh - the hash to look upI2PSessionException - on errorpublic Destination lookupDest(String name) throws I2PSessionException
lookupDest in interface I2PSessionlookupDest in class I2PSessionImplname - the hostname to look upI2PSessionException - on errorpublic Destination lookupDest(String name, long maxWait) throws I2PSessionException
lookupDest in interface I2PSessionlookupDest in class I2PSessionImplmaxWait - msname - the hostname to look upI2PSessionException - on errorvoid propagateError(String msg, Throwable error)
propagateError in class I2PSessionImplerror - non-nullmsg - the error messageprotected boolean reconnect()
I2PSessionImpl2reconnect in class I2PSessionImpl2public void removeSubsession(I2PSession session)
removeSubsession in interface I2PSessionremoveSubsession in class I2PSessionImplsession - the subsession to removevoid sendMessage_unchecked(I2CPMessage message) throws I2PSessionException
sendMessage_unchecked in class I2PSessionImplmessage - the I2CP message to sendI2PSessionException - if the message is malformed or there is an error writing it outvoid sendMessage(I2CPMessage message) throws I2PSessionException
sendMessage in class I2PSessionImplmessage - the I2CP message to sendI2PSessionException - if the message is malformed or there is an error writing it outpublic void setReduced()
I2PSessionImplsetReduced in class I2PSessionImplprotected void updateActivity()
I2PSessionImplupdateActivity in class I2PSessionImplpublic void updateOptions(Properties options)
updateOptions in interface I2PSessionupdateOptions in class I2PSessionImploptions - non-null