|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.klomp.snark.ExtensionHandler
abstract class ExtensionHandler
REF: BEP 10 Extension Protocol
Field Summary | |
---|---|
static int |
ID_DHT
|
static int |
ID_HANDSHAKE
|
static int |
ID_METADATA
|
static int |
ID_PEX
|
static String |
TYPE_DHT
not using the option bit since the compact format is different |
static String |
TYPE_METADATA
|
static String |
TYPE_PEX
not ut_pex since the compact format is different |
Constructor Summary | |
---|---|
ExtensionHandler()
|
Method Summary | |
---|---|
static byte[] |
getHandshake(int metasize,
boolean pexAndMetadata,
boolean dht)
|
static void |
handleMessage(Peer peer,
PeerListener listener,
int id,
byte[] bs)
|
static void |
sendDHT(Peer peer,
int qport,
int rport)
Send the DHT port numbers |
static void |
sendPEX(Peer peer,
List<Peer> pList)
added.f and dropped unsupported |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ID_HANDSHAKE
public static final int ID_METADATA
public static final String TYPE_METADATA
public static final int ID_PEX
public static final String TYPE_PEX
public static final int ID_DHT
public static final String TYPE_DHT
Constructor Detail |
---|
ExtensionHandler()
Method Detail |
---|
public static byte[] getHandshake(int metasize, boolean pexAndMetadata, boolean dht)
metasize
- -1 if unknownpexAndMetadata
- advertise these capabilitiesdht
- advertise DHT capability
public static void handleMessage(Peer peer, PeerListener listener, int id, byte[] bs)
public static void sendPEX(Peer peer, List<Peer> pList)
pList
- non-nullpublic static void sendDHT(Peer peer, int qport, int rport)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |