Enum Class CloseReason
- All Implemented Interfaces:
Serializable,Comparable<CloseReason>,Constable
These are all the reasons to disconnect a peer
all reasons caused by the peer sending unexpected data.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe source IP has been blocked.The peer sent corrupt data.We're already connected to.The encryption handshake failed.The info hash sent as part of the handshake was not what we expected.The metadata received matched the info-hash, but failed to parse.The advertised metadata size.Client failed to allocate necessary memory for this peer connection.No reason specified.Connection was closed because the other end is upload only and does not have any pieces we're interested in.The peer was disconnected in the hopes of finding a better peer in the swarm.The source port of this peer is blocked.The encryption mode is blocked.The peer sent a request while being choked.The peer has not sent any message in a long time.The peer did not complete the handshake in too long.The peers have not been interested in each other for a very long time.The peer sent an interested message, but did not send a request after a very long time after being unchoked.Peer connection timed out (generic timeout).We have too many peers connected.We have too many file-descriptors open.This torrent has been removed, paused or stopped from this client.Both ends of the connection are upload-only. -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseReasonfromSwig(int swigValue) Converted method, it's public in order to be used in other internal packages.intswig()static CloseReasonReturns the enum constant of this class with the specified name.static CloseReason[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No reason specified. Generic close. -
DUPLICATE_PEER_ID
We're already connected to. -
TORRENT_REMOVED
This torrent has been removed, paused or stopped from this client. -
NO_MEMORY
Client failed to allocate necessary memory for this peer connection. -
PORT_BLOCKED
The source port of this peer is blocked. -
BLOCKED
The source IP has been blocked. -
UPLOAD_TO_UPLOAD
Both ends of the connection are upload-only. Staying connected would be redundant. -
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
Peer connection timed out (generic timeout). -
TIMED_OUT_INTEREST
The peers have not been interested in each other for a very long time. disconnect. -
TIMED_OUT_ACTIVITY
The peer has not sent any message in a long time. -
TIMED_OUT_HANDSHAKE
The peer did not complete the handshake in too long. -
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
The encryption mode is blocked. -
PEER_CHURN
The peer was disconnected in the hopes of finding a better peer in the swarm. -
TOO_MANY_CONNECTIONS
We have too many peers connected. -
TOO_MANY_FILES
We have too many file-descriptors open. -
ENCRYPTION_ERROR
The encryption handshake failed. -
INVALID_INFO_HASH
The info hash sent as part of the handshake was not what we expected. -
SELF_CONNECTION
-
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
The advertised metadata size. -
MESSAGE_TOO_BIG
-
INVALID_MESSAGE_ID
-
INVALID_MESSAGE
-
INVALID_PIECE_MESSAGE
-
INVALID_HAVE_MESSAGE
-
INVALID_BITFIELD_MESSAGE
-
INVALID_CHOKE_MESSAGE
-
INVALID_UNCHOKE_MESSAGE
-
INVALID_INTERESTED_MESSAGE
-
INVALID_NOT_INTERESTED_MESSAGE
-
INVALID_REQUEST_MESSAGE
-
INVALID_REJECT_MESSAGE
-
INVALID_ALLOW_FAST_MESSAGE
-
NVALID_EXTENDED_MESSAGE
-
INVALID_CANCEL_MESSAGE
-
INVALID_DHT_PORT_MESSAGE
-
INVALID_SUGGEST_MESSAGE
-
INVALID_HAVE_ALL_MESSAGE
-
INVALID_DONT_HAVE_MESSAGE
-
INVALID_HAVE_NONE_MESSAGE
-
INVALID_PEX_MESSAGE
-
INVALID_METADATA_REQUEST_MESSAGE
-
INVALID_METADATA_MESSAGE
-
INVALID_METADATA_OFFSET
-
REQUEST_WHEN_CHOKED
The peer sent a request while being choked. -
CORRUPT_PIECES
The peer sent corrupt data. -
PEX_MESSAGE_TOO_BIG
-
PEX_TOO_FREQUENT
-
UNKNOWN
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
swig
public int swig()- Returns:
- the native value
-
fromSwig
Converted method, it's public in order to be used in other internal packages.- Parameters:
swigValue- the native value- Returns:
- the enum value
-