1
0
mirror of https://github.com/veggiedefender/torrent-client.git synced 2025-11-06 09:29:16 +02:00

More informative comments for message IDs

This commit is contained in:
Jesse Li
2020-01-02 12:29:10 -05:00
parent b3beb5ed2a
commit 81a6437145

View File

@@ -9,18 +9,25 @@ import (
type messageID uint8
// Message ID
const (
MsgChoke messageID = 0
MsgUnchoke messageID = 1
MsgInterested messageID = 2
// MsgChoke chokes the receiver
MsgChoke messageID = 0
// MsgUnchoke unchokes the receiver
MsgUnchoke messageID = 1
// MsgInterested expresses interest in receiving data
MsgInterested messageID = 2
// MsgNotInterested expresses disinterest in receiving data
MsgNotInterested messageID = 3
MsgHave messageID = 4
MsgBitfield messageID = 5
MsgRequest messageID = 6
MsgPiece messageID = 7
MsgCancel messageID = 8
MsgPort messageID = 9
// MsgHave alerts the receiver that the sender has downloaded a piece
MsgHave messageID = 4
// MsgBitfield encodes which pieces that the sender has downloaded
MsgBitfield messageID = 5
// MsgRequest requests a block of data from the receiver
MsgRequest messageID = 6
// MsgPiece delivers a block of data to fulfill a request
MsgPiece messageID = 7
// MsgCancel cancels a request
MsgCancel messageID = 8
)
// Message stores ID and payload of a message