class UDPTrackerClient extends Object implements I2PSessionMuxedListener
client tracker type ------ ------- ---- announce --> repliable <-- ann resp raw
Modifier and Type | Class and Description |
---|---|
static class |
UDPTrackerClient.TrackerResponse |
Modifier and Type | Field and Description |
---|---|
static int |
EVENT_COMPLETED |
static int |
EVENT_NONE |
static int |
EVENT_STARTED |
static int |
EVENT_STOPPED |
Constructor and Description |
---|
UDPTrackerClient(I2PAppContext ctx,
I2PSession session,
I2PSnarkUtil util) |
Modifier and Type | Method and Description |
---|---|
UDPTrackerClient.TrackerResponse |
announce(byte[] ih,
byte[] peerID,
int max,
long maxWait,
String toHost,
int toPort,
long downloaded,
long left,
long uploaded,
int event,
boolean fast)
Announce and get peers for a torrent.
|
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)
for non-muxed
|
void |
messageAvailable(I2PSession session,
int msgId,
long size,
int proto,
int fromPort,
int toPort)
Instruct the client that the given session has received a message
Will be called only if you register via addMuxedSessionListener().
|
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 |
start()
Can't be restarted after stopping?
|
void |
stop()
Stop everything.
|
public static final int EVENT_NONE
public static final int EVENT_COMPLETED
public static final int EVENT_STARTED
public static final int EVENT_STOPPED
public UDPTrackerClient(I2PAppContext ctx, I2PSession session, I2PSnarkUtil util)
public void start()
public void stop()
public UDPTrackerClient.TrackerResponse announce(byte[] ih, byte[] peerID, int max, long maxWait, String toHost, int toPort, long downloaded, long left, long uploaded, int event, boolean fast)
ih
- the Info Hash (torrent)max
- maximum number of peers to returnmaxWait
- the maximum time to wait (ms) must be greater than 0fast
- if true, don't wait for dest, no retx, ...public void messageAvailable(I2PSession session, int msgId, long size, int proto, int fromPort, int toPort)
messageAvailable
in interface I2PSessionMuxedListener
session
- session to notifymsgId
- message number availablesize
- size of the message - why it's a long and not an int is a mysteryproto
- 1-254 or 0 for unspecifiedfromPort
- 1-65535 or 0 for unspecifiedtoPort
- 1-65535 or 0 for unspecifiedpublic void messageAvailable(I2PSession session, int msgId, long size)
messageAvailable
in interface I2PSessionListener
messageAvailable
in interface I2PSessionMuxedListener
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)
I2PSessionMuxedListener
reportAbuse
in interface I2PSessionListener
reportAbuse
in interface I2PSessionMuxedListener
session
- session to report abuse toseverity
- how bad the abuse ispublic void disconnected(I2PSession session)
I2PSessionMuxedListener
disconnected
in interface I2PSessionListener
disconnected
in interface I2PSessionMuxedListener
public void errorOccurred(I2PSession session, String message, Throwable error)
I2PSessionMuxedListener
errorOccurred
in interface I2PSessionListener
errorOccurred
in interface I2PSessionMuxedListener
error
- can be null? or not?