#[repr(u16)]pub enum CloseReason {
Show 50 variants
None = 0,
DuplicatePeerId = 1,
TorrentRemoved = 2,
NoMemory = 3,
PortBlocked = 4,
Blocked = 5,
UploadToUpload = 6,
NotInterestedUploadOnly = 7,
Timeout = 8,
TimedOutInterest = 9,
TimedOutActivity = 10,
TimedOutHandshake = 11,
TimedOutRequest = 12,
ProtocolBlocked = 13,
PeerChurn = 14,
TooManyConnections = 15,
TooManyFiles = 16,
EncryptionError = 256,
InvalidInfoHash = 257,
SelfConnection = 258,
InvalidMetadata = 259,
MetadataTooBig = 260,
MessageTooBig = 261,
InvalidMessageId = 262,
InvalidMessage = 263,
InvalidPieceMessage = 264,
InvalidHaveMessage = 265,
InvalidBitfieldMessage = 266,
InvalidChokeMessage = 267,
InvalidUnchokeMessage = 268,
InvalidInterestedMessage = 269,
InvalidNotInterestedMessage = 270,
InvalidRequestMessage = 271,
InvalidRejectMessage = 272,
InvalidAllowFastMessage = 273,
InvalidExtendedMessage = 274,
InvalidCancelMessage = 275,
InvalidDhtPortMessage = 276,
InvalidSuggestMessage = 277,
InvalidHaveAllMessage = 278,
InvalidDontHaveMessage = 279,
InvalidHaveNoneMessage = 280,
InvalidPexMessage = 281,
InvalidMetadataRequestMessage = 282,
InvalidMetadataMessage = 283,
InvalidMetadataOffset = 284,
RequestWhenChoked = 285,
CorruptPieces = 286,
PexMessageTooBig = 287,
PexTooFrequent = 288,
}Expand description
These are all the reasons to disconnect a peer all reasons caused by the peer sending unexpected data are 256 and up.
Variants§
None = 0
No reason specified. Generic close.
DuplicatePeerId = 1
We’re already connected to
TorrentRemoved = 2
This torrent has been removed, paused or stopped from this client.
NoMemory = 3
Client failed to allocate necessary memory for this peer connection
PortBlocked = 4
The source port of this peer is blocked
Blocked = 5
The source IP has been blocked
UploadToUpload = 6
Both ends of the connection are upload-only. staying connected would be redundant
NotInterestedUploadOnly = 7
Connection was closed because the other end is upload only and does not have any pieces we’re interested in
Timeout = 8
Peer connection timed out (generic timeout)
TimedOutInterest = 9
The peers have not been interested in each other for a very long time. disconnect
TimedOutActivity = 10
The peer has not sent any message in a long time.
TimedOutHandshake = 11
The peer did not complete the handshake in too long
TimedOutRequest = 12
The peer sent an interested message, but did not send a request after a very long time after being unchoked.
ProtocolBlocked = 13
The encryption mode is blocked
PeerChurn = 14
The peer was disconnected in the hopes of finding a better peer in the swarm
TooManyConnections = 15
We have too many peers connected
TooManyFiles = 16
We have too many file-descriptors open
EncryptionError = 256
The encryption handshake failed
InvalidInfoHash = 257
The info hash sent as part of the handshake was not what we expected
SelfConnection = 258
InvalidMetadata = 259
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
MetadataTooBig = 260
The advertised metadata size
MessageTooBig = 261
Invalid bittorrent messages
InvalidMessageId = 262
InvalidMessage = 263
InvalidPieceMessage = 264
InvalidHaveMessage = 265
InvalidBitfieldMessage = 266
InvalidChokeMessage = 267
InvalidUnchokeMessage = 268
InvalidInterestedMessage = 269
InvalidNotInterestedMessage = 270
InvalidRequestMessage = 271
InvalidRejectMessage = 272
InvalidAllowFastMessage = 273
InvalidExtendedMessage = 274
InvalidCancelMessage = 275
InvalidDhtPortMessage = 276
InvalidSuggestMessage = 277
InvalidHaveAllMessage = 278
InvalidDontHaveMessage = 279
InvalidHaveNoneMessage = 280
InvalidPexMessage = 281
InvalidMetadataRequestMessage = 282
InvalidMetadataMessage = 283
InvalidMetadataOffset = 284
RequestWhenChoked = 285
The peer sent a request while being choked
CorruptPieces = 286
The peer sent corrupt data
PexMessageTooBig = 287
PexTooFrequent = 288
Trait Implementations§
Source§impl Clone for CloseReason
impl Clone for CloseReason
Source§fn clone(&self) -> CloseReason
fn clone(&self) -> CloseReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more