Interface MainlineDHTProvider


  • public interface MainlineDHTProvider
    The interface that a plugin (or a helper class) must implement to enable DHT support inside the client. By implementing this class, and then registering it via MainlineDHTManager.setProvider(MainlineDHTProvider), The client will indicate DHT support via the BT handshake, and exchange PORT messages with other clients - passing received messages to this class.
    • Method Detail

      • notifyOfIncomingPort

        void notifyOfIncomingPort​(java.lang.String ip_addr,
                                  int port)
        This method is called by the client when a PORT message is received by a peer. Note: When this method is called, try to make sure that it won't take long to return - if it needs to do something time-consuming, then the work should be delegated to another thread.
        Parameters:
        ip_addr - IP address of peer.
        port - DHT port of peer.
      • getDHTPort

        int getDHTPort()
        Returns the DHT port used by the plugin.