Class ListenFailedAlert

java.lang.Object
com.frostwire.jlibtorrent.alerts.AbstractAlert<listen_failed_alert>
com.frostwire.jlibtorrent.alerts.ListenFailedAlert
All Implemented Interfaces:
Alert<listen_failed_alert>

public final class ListenFailedAlert extends AbstractAlert<listen_failed_alert>
This alert is generated when none of the ports, given in the port range, to session can be opened for listening. The listenInterface() member is the interface and port that failed, error() is the error code describing the failure.

In the case an endpoint was created before generating the alert, it is represented by ``address`` and ``port``. The combinations of socket type and operation in which such address and port are not valid are: accept - i2p accept - socks5 enum_if - tcp

libtorrent may sometimes try to listen on port 0, if all other ports failed. Port 0 asks the operating system to pick a port that's free). If that fails you may see a ListenFailedAlert with port 0 even if you didn't ask to listen on it.

  • Method Details

    • listenInterface

      public String listenInterface()
      The interface libtorrent attempted to listen on that failed.
      Returns:
      the listen interface (as string).
    • error

      public ErrorCode error()
      The error the system returned.
      Returns:
      the error.
    • operation

      public Operation operation()
      The specific low level operation that failed.
      Returns:
      the operation.
    • socketType

      public SocketType socketType()
      The type of listen socket this alert refers to.
      Returns:
      the socket type.
    • address

      public Address address()
      The address libtorrent attempted to listen on. See alert's documentation for validity of this value.
      Returns:
      the address attempted to listen on.
    • port

      public int port()
      The port libtorrent attempted to listen on see alert's documentation for validity of this value.
      Returns:
      the port.