Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 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 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 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { ID messageID Payload []byte }
Message stores ID and payload of a message
func FormatRequest ¶
FormatRequest creates a REQUEST message
Click to show internal directories.
Click to hide internal directories.