torrent/peer-impl.go

28 lines
746 B
Go
Raw Normal View History

2020-06-02 07:41:59 +00: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 {
onNextRequestStateChanged()
2020-06-02 07:41:59 +00:00
updateRequests()
writeInterested(interested bool) bool
2021-05-09 13:38:38 +00: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(Request) bool
_request(Request) bool
2021-05-09 13:38:38 +00:00
2020-06-02 07:41:59 +00:00
connectionFlags() string
2021-01-04 04:51:23 +00:00
onClose()
2020-06-02 07:41:59 +00:00
onGotInfo(*metainfo.Info)
drop()
String() string
connStatusString() string
writeBufferFull() bool
2020-06-02 07:41:59 +00:00
}