abstract class ExtensionHandler extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
ExtensionHandler() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
getHandshake(int metasize,
boolean pexAndMetadata,
boolean dht,
boolean uploadOnly) |
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
|
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
public static byte[] getHandshake(int metasize, boolean pexAndMetadata, boolean dht, boolean uploadOnly)
metasize
- -1 if unknownpexAndMetadata
- advertise these capabilitiesdht
- advertise DHT capabilitypublic 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)