class SubSession extends I2PSessionMuxedImpl
I2PSessionMuxedImpl.MuxedAvailabilityNotifier
I2PSessionImpl.AvailabilityNotifier, I2PSessionImpl.State
_noEffort, _sendingStates, _sendMessageNonce
_availabilityNotifier, _availableMessages, _bwLimits, _bwReceivedLock, _context, _handlerMap, _hostname, _leaseSet, _leaseSetWait, _log, _pendingLookups, _portNum, _producer, _queue, _reader, _sessionListener, _socket, _state, _stateLock, _writer, CACHE_MAX_SIZE, LISTEN_PORT, PROP_DOMAIN_SOCKET, PROP_ENABLE_SSL, PROP_PW, PROP_USER
PORT_ANY, PORT_UNSPECIFIED, PROTO_ANY, PROTO_DATAGRAM, PROTO_DATAGRAM_RAW, PROTO_STREAMING, PROTO_UNSPECIFIED
Constructor and Description |
---|
SubSession(I2PSession primary,
InputStream destKeyStream,
Properties options) |
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)
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.
|
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() |
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 |
propogateError(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() |
protected void |
updateActivity() |
void |
updateOptions(Properties options)
Does nothing for now
|
addMuxedSessionListener, addNewMessage, addSessionListener, removeListener, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, setSessionListener
destroySession, getTimeout, receiveMessage, receiveStatus, sendBestEffort, sendBestEffort, sendMessage, sendMessage, sendMessage, sendNoEffort, shouldCompress, startVerifyUsage
changeState, clearCache, dateUpdated, disconnected, getContext, getDecryptionKey, getFastReceive, getHandlerMap, getLeaseSet, getMyDestination, getOptions, getPrefix, getPrivateKey, getProducer, getSessionId, messageReceived, readError, reportAbuse, setLeaseSet, setSessionId, shouldReconnect, toString, verifyOpen, waitForDate
public SubSession(I2PSession primary, InputStream destKeyStream, Properties options) throws I2PSessionException
primary
- must be a I2PSessionMuxedImplI2PSessionException
public I2PSession addSubsession(InputStream destKeyStream, Properties opts) throws I2PSessionException
addSubsession
in interface I2PSession
addSubsession
in class I2PSessionImpl
destKeyStream
- 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
public void removeSubsession(I2PSession session)
removeSubsession
in interface I2PSession
removeSubsession
in class I2PSessionImpl
public List<I2PSession> getSubsessions()
getSubsessions
in interface I2PSession
getSubsessions
in class I2PSessionImpl
public void updateOptions(Properties options)
updateOptions
in interface I2PSession
updateOptions
in class I2PSessionImpl
options
- non-nullpublic void connect() throws I2PSessionException
connect
in interface I2PSession
connect
in class I2PSessionImpl
I2PSessionException
- if there is a configuration error or the router is
not reachablepublic boolean isClosed()
isClosed
in interface I2PSession
isClosed
in class I2PSessionImpl
void sendMessage(I2CPMessage message) throws I2PSessionException
sendMessage
in class I2PSessionImpl
I2PSessionException
- if the message is malformed or there is an error writing it outvoid sendMessage_unchecked(I2CPMessage message) throws I2PSessionException
sendMessage_unchecked
in class I2PSessionImpl
I2PSessionException
- if the message is malformed or there is an error writing it outvoid propogateError(String msg, Throwable error)
propogateError
in class I2PSessionImpl
error
- non-nullpublic void destroySession()
destroySession
in interface I2PSession
destroySession
in class I2PSessionImpl
protected void disconnect()
disconnect
in class I2PSessionImpl
protected boolean reconnect()
I2PSessionImpl2
reconnect
in class I2PSessionImpl2
void destReceived(Destination d)
destReceived
in class I2PSessionImpl
d
- non-nullvoid destLookupFailed(Hash h)
destLookupFailed
in class I2PSessionImpl
h
- non-nullvoid destReceived(long nonce, Destination d)
destReceived
in class I2PSessionImpl
d
- non-nullvoid destLookupFailed(long nonce)
destLookupFailed
in class I2PSessionImpl
void bwReceived(int[] i)
bwReceived
in class I2PSessionImpl
public Destination lookupDest(Hash h) throws I2PSessionException
lookupDest
in interface I2PSession
lookupDest
in class I2PSessionImpl
I2PSessionException
public Destination lookupDest(Hash h, long maxWait) throws I2PSessionException
lookupDest
in interface I2PSession
lookupDest
in class I2PSessionImpl
maxWait
- msI2PSessionException
public Destination lookupDest(String name) throws I2PSessionException
lookupDest
in interface I2PSession
lookupDest
in class I2PSessionImpl
I2PSessionException
public Destination lookupDest(String name, long maxWait) throws I2PSessionException
lookupDest
in interface I2PSession
lookupDest
in class I2PSessionImpl
maxWait
- msI2PSessionException
public int[] bandwidthLimits() throws I2PSessionException
bandwidthLimits
in interface I2PSession
bandwidthLimits
in class I2PSessionImpl
I2PSessionException
protected void updateActivity()
updateActivity
in class I2PSessionImpl
public long lastActivity()
lastActivity
in class I2PSessionImpl
public void setReduced()
setReduced
in class I2PSessionImpl