]> Sergey Matveev's repositories - btrtrc.git/blob - peer-impl.go
Add pprof labels for request updates and remove Client-wide requester
[btrtrc.git] / peer-impl.go
1 package torrent
2
3 import (
4         "github.com/anacrolix/torrent/metainfo"
5 )
6
7 // Contains implementation details that differ between peer types, like Webseeds and regular
8 // BitTorrent protocol connections. Some methods are underlined so as to avoid collisions with
9 // legacy PeerConn methods.
10 type peerImpl interface {
11         onNextRequestStateChanged()
12         updateRequests(reason string)
13         writeInterested(interested bool) bool
14
15         // Neither of these return buffer room anymore, because they're currently both posted. There's
16         // also PeerConn.writeBufferFull for when/where it matters.
17         _cancel(Request) bool
18         _request(Request) bool
19
20         connectionFlags() string
21         onClose()
22         onGotInfo(*metainfo.Info)
23         drop()
24         String() string
25         connStatusString() string
26         writeBufferFull() bool
27 }