]> Sergey Matveev's repositories - btrtrc.git/blob - peer-impl.go
Add low requests check
[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         // Trigger the actual request state to get updated
12         handleUpdateRequests()
13         // Whether the outstanding local request cardinality is low enough to warrant an update.
14         isLowOnRequests() bool
15         writeInterested(interested bool) bool
16
17         // Neither of these return buffer room anymore, because they're currently both posted. There's
18         // also PeerConn.writeBufferFull for when/where it matters.
19         _cancel(RequestIndex) bool
20         _request(Request) bool
21
22         connectionFlags() string
23         onClose()
24         onGotInfo(*metainfo.Info)
25         drop()
26         String() string
27         connStatusString() string
28 }