Class ExtensionHandler


  • abstract class ExtensionHandler
    extends Object
    REF: BEP 10 Extension Protocol
    Since:
    0.8.2
    Author:
    zzz
    • Constructor Detail

      • ExtensionHandler

        ExtensionHandler()
    • Method Detail

      • getHandshake

        public static byte[] getHandshake​(int metasize,
                                          boolean pexAndMetadata,
                                          boolean dht,
                                          boolean uploadOnly,
                                          boolean comment)
        Parameters:
        metasize - -1 if unknown
        pexAndMetadata - advertise these capabilities
        dht - advertise DHT capability
        comment - advertise ut_comment capability
        Returns:
        bencoded outgoing handshake message
      • handleMessage

        public static void handleMessage​(Peer peer,
                                         PeerListener listener,
                                         int id,
                                         byte[] bs)
      • sendPEX

        public static void sendPEX​(Peer peer,
                                   List<Peer> pList)
        added.f and dropped unsupported
        Parameters:
        pList - non-null
        Since:
        0.8.4
      • sendDHT

        public static void sendDHT​(Peer peer,
                                   int qport,
                                   int rport)
        Send the DHT port numbers
        Since:
        DHT
      • sendCommentReq

        public static void sendCommentReq​(Peer peer,
                                          int num)
        Send comment request
        Since:
        0.9.31
      • locked_sendComments

        public static void locked_sendComments​(Peer peer,
                                               int num,
                                               CommentSet comments)
        Send comments Caller must sync on comments
        Parameters:
        num - max to send
        comments - non-null
        Since:
        0.9.31