2
0
mirror of synced 2025-02-24 06:38:14 +00:00
torrent/peer-impl.go

29 lines
870 B
Go
Raw Normal View History

2020-06-02 17:41:59 +10:00
package torrent
import (
"github.com/anacrolix/torrent/metainfo"
)
// Contains implementation details that differ between peer types, like Webseeds and regular
// BitTorrent protocol connections. Some methods are underlined so as to avoid collisions with
// legacy PeerConn methods.
type peerImpl interface {
2021-10-21 10:28:57 +11:00
// Trigger the actual request state to get updated
handleUpdateRequests()
// Whether the outstanding local request cardinality is low enough to warrant an update.
isLowOnRequests() bool
2020-06-02 17:41:59 +10:00
writeInterested(interested bool) bool
2021-05-09 23:38:38 +10:00
// Neither of these return buffer room anymore, because they're currently both posted. There's
// also PeerConn.writeBufferFull for when/where it matters.
_cancel(RequestIndex) bool
_request(Request) bool
2021-05-09 23:38:38 +10:00
2020-06-02 17:41:59 +10:00
connectionFlags() string
2021-01-04 15:51:23 +11:00
onClose()
2020-06-02 17:41:59 +10:00
onGotInfo(*metainfo.Info)
drop()
String() string
connStatusString() string
2020-06-02 17:41:59 +10:00
}