aboutsummaryrefslogtreecommitdiff
path: root/peer/messages.go
blob: a14de4675daad842d01bb89f69caf0ae121e6f72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package peer

type Message int

const (
	Choke         Message = iota // choke: <len=0001><id=0>
	Unchoke                      // unchoke: <len=0001><id=1>
	Interested                   // interested: <len=0001><id=2>
	NotInterested                // not interested: <len=0001><id=3>
	Have                         // have: <len=0005><id=4><piece index>
	BitField                     // bitfield: <len=0001+X><id=5><bitfield>
	Request                      // request: <len=0013><id=6><index><begin><length>
	Piece                        // piece: <len=0009+X><id=7><index><begin><block>
	Cancel                       // cancel: <len=0013><id=8><index><begin><length>
	Port                         // port: <len=0003><id=9><listen-port>
	_                            // keep-alive: <len=0000>
)

const Proto = `BitTorrent protocol`