Enum Class CloseReason

java.lang.Object
java.lang.Enum<CloseReason>
com.frostwire.jlibtorrent.alerts.CloseReason
All Implemented Interfaces:
Serializable, Comparable<CloseReason>, Constable

public enum CloseReason extends Enum<CloseReason>
These are all the reasons to disconnect a peer all reasons caused by the peer sending unexpected data.
  • Enum Constant Details

    • NONE

      public static final CloseReason NONE
      No reason specified. Generic close.
    • DUPLICATE_PEER_ID

      public static final CloseReason DUPLICATE_PEER_ID
      We're already connected to.
    • TORRENT_REMOVED

      public static final CloseReason TORRENT_REMOVED
      This torrent has been removed, paused or stopped from this client.
    • NO_MEMORY

      public static final CloseReason NO_MEMORY
      Client failed to allocate necessary memory for this peer connection.
    • PORT_BLOCKED

      public static final CloseReason PORT_BLOCKED
      The source port of this peer is blocked.
    • BLOCKED

      public static final CloseReason BLOCKED
      The source IP has been blocked.
    • UPLOAD_TO_UPLOAD

      public static final CloseReason UPLOAD_TO_UPLOAD
      Both ends of the connection are upload-only. Staying connected would be redundant.
    • NOT_INTERESTED_UPLOAD_ONLY

      public static final CloseReason NOT_INTERESTED_UPLOAD_ONLY
      Connection was closed because the other end is upload only and does not have any pieces we're interested in.
    • TIMEOUT

      public static final CloseReason TIMEOUT
      Peer connection timed out (generic timeout).
    • TIMED_OUT_INTEREST

      public static final CloseReason TIMED_OUT_INTEREST
      The peers have not been interested in each other for a very long time. disconnect.
    • TIMED_OUT_ACTIVITY

      public static final CloseReason TIMED_OUT_ACTIVITY
      The peer has not sent any message in a long time.
    • TIMED_OUT_HANDSHAKE

      public static final CloseReason TIMED_OUT_HANDSHAKE
      The peer did not complete the handshake in too long.
    • TIMED_OUT_REQUEST

      public static final CloseReason TIMED_OUT_REQUEST
      The peer sent an interested message, but did not send a request after a very long time after being unchoked.
    • PROTOCOL_BLOCKED

      public static final CloseReason PROTOCOL_BLOCKED
      The encryption mode is blocked.
    • PEER_CHURN

      public static final CloseReason PEER_CHURN
      The peer was disconnected in the hopes of finding a better peer in the swarm.
    • TOO_MANY_CONNECTIONS

      public static final CloseReason TOO_MANY_CONNECTIONS
      We have too many peers connected.
    • TOO_MANY_FILES

      public static final CloseReason TOO_MANY_FILES
      We have too many file-descriptors open.
    • ENCRYPTION_ERROR

      public static final CloseReason ENCRYPTION_ERROR
      The encryption handshake failed.
    • INVALID_INFO_HASH

      public static final CloseReason INVALID_INFO_HASH
      The info hash sent as part of the handshake was not what we expected.
    • SELF_CONNECTION

      public static final CloseReason SELF_CONNECTION
    • INVALID_METADATA

      public static final CloseReason INVALID_METADATA
      The metadata received matched the info-hash, but failed to parse. this is either someone finding a SHA1 collision, or the author of the magnet link creating it from an invalid torrent.
    • METADATA_TOO_BIG

      public static final CloseReason METADATA_TOO_BIG
      The advertised metadata size.
    • MESSAGE_TOO_BIG

      public static final CloseReason MESSAGE_TOO_BIG
    • INVALID_MESSAGE_ID

      public static final CloseReason INVALID_MESSAGE_ID
    • INVALID_MESSAGE

      public static final CloseReason INVALID_MESSAGE
    • INVALID_PIECE_MESSAGE

      public static final CloseReason INVALID_PIECE_MESSAGE
    • INVALID_HAVE_MESSAGE

      public static final CloseReason INVALID_HAVE_MESSAGE
    • INVALID_BITFIELD_MESSAGE

      public static final CloseReason INVALID_BITFIELD_MESSAGE
    • INVALID_CHOKE_MESSAGE

      public static final CloseReason INVALID_CHOKE_MESSAGE
    • INVALID_UNCHOKE_MESSAGE

      public static final CloseReason INVALID_UNCHOKE_MESSAGE
    • INVALID_INTERESTED_MESSAGE

      public static final CloseReason INVALID_INTERESTED_MESSAGE
    • INVALID_NOT_INTERESTED_MESSAGE

      public static final CloseReason INVALID_NOT_INTERESTED_MESSAGE
    • INVALID_REQUEST_MESSAGE

      public static final CloseReason INVALID_REQUEST_MESSAGE
    • INVALID_REJECT_MESSAGE

      public static final CloseReason INVALID_REJECT_MESSAGE
    • INVALID_ALLOW_FAST_MESSAGE

      public static final CloseReason INVALID_ALLOW_FAST_MESSAGE
    • NVALID_EXTENDED_MESSAGE

      public static final CloseReason NVALID_EXTENDED_MESSAGE
    • INVALID_CANCEL_MESSAGE

      public static final CloseReason INVALID_CANCEL_MESSAGE
    • INVALID_DHT_PORT_MESSAGE

      public static final CloseReason INVALID_DHT_PORT_MESSAGE
    • INVALID_SUGGEST_MESSAGE

      public static final CloseReason INVALID_SUGGEST_MESSAGE
    • INVALID_HAVE_ALL_MESSAGE

      public static final CloseReason INVALID_HAVE_ALL_MESSAGE
    • INVALID_DONT_HAVE_MESSAGE

      public static final CloseReason INVALID_DONT_HAVE_MESSAGE
    • INVALID_HAVE_NONE_MESSAGE

      public static final CloseReason INVALID_HAVE_NONE_MESSAGE
    • INVALID_PEX_MESSAGE

      public static final CloseReason INVALID_PEX_MESSAGE
    • INVALID_METADATA_REQUEST_MESSAGE

      public static final CloseReason INVALID_METADATA_REQUEST_MESSAGE
    • INVALID_METADATA_MESSAGE

      public static final CloseReason INVALID_METADATA_MESSAGE
    • INVALID_METADATA_OFFSET

      public static final CloseReason INVALID_METADATA_OFFSET
    • REQUEST_WHEN_CHOKED

      public static final CloseReason REQUEST_WHEN_CHOKED
      The peer sent a request while being choked.
    • CORRUPT_PIECES

      public static final CloseReason CORRUPT_PIECES
      The peer sent corrupt data.
    • PEX_MESSAGE_TOO_BIG

      public static final CloseReason PEX_MESSAGE_TOO_BIG
    • PEX_TOO_FREQUENT

      public static final CloseReason PEX_TOO_FREQUENT
    • UNKNOWN

      public static final CloseReason UNKNOWN
  • Method Details

    • values

      public static CloseReason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CloseReason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • swig

      public int swig()
      Returns:
      the native value
    • fromSwig

      public static CloseReason fromSwig(int swigValue)
      Converted method, it's public in order to be used in other internal packages.
      Parameters:
      swigValue - the native value
      Returns:
      the enum value