net.i2p.sam
public class SAMMessageSession.SAMMessageSessionHandler extends Object implements Runnable, I2PSessionListener
Constructor and Description |
---|
SAMMessageSession.SAMMessageSessionHandler(InputStream destStream,
Properties props)
Create a new SAM message-based session handler
|
Modifier and Type | Method and Description |
---|---|
void |
disconnected(I2PSession session)
Notify the client that the session has been terminated
|
void |
errorOccurred(I2PSession session,
String message,
Throwable error)
Notify the client that some error occurred
|
void |
messageAvailable(I2PSession session,
int msgId,
long size)
Instruct the client that the given session has received a message with
size # of bytes.
|
void |
reportAbuse(I2PSession session,
int severity)
Instruct the client that the session specified seems to be under attack
and that the client may wish to move its destination to another router.
|
void |
run() |
void |
stopRunning()
Stop a SAM message-based session handling thread
|
public SAMMessageSession.SAMMessageSessionHandler(InputStream destStream, Properties props) throws I2PSessionException
destStream
- Input stream containing the destination keysprops
- Properties to setup the I2P sessionI2PSessionException
public final void stopRunning()
public void disconnected(I2PSession session)
I2PSessionListener
disconnected
in interface I2PSessionListener
public void errorOccurred(I2PSession session, String message, Throwable error)
I2PSessionListener
errorOccurred
in interface I2PSessionListener
error
- can be null? or not?public void messageAvailable(I2PSession session, int msgId, long size)
I2PSessionListener
messageAvailable
in interface I2PSessionListener
session
- session to notifymsgId
- message number availablesize
- size of the message - why it's a long and not an int is a mysterypublic void reportAbuse(I2PSession session, int severity)
I2PSessionListener
reportAbuse
in interface I2PSessionListener
session
- session to report abuse toseverity
- how bad the abuse is