]> Sergey Matveev's repositories - btrtrc.git/blob - callbacks.go
Add PeerConnClosed callback
[btrtrc.git] / callbacks.go
1 package torrent
2
3 import (
4         pp "github.com/anacrolix/torrent/peer_protocol"
5 )
6
7 // These are called synchronously, and do not pass ownership. The Client and other locks may still
8 // be held. nil functions are not called.
9 type Callbacks struct {
10         CompletedHandshake    func(_ *PeerConn, infoHash InfoHash)
11         ReadMessage           func(*PeerConn, *pp.Message)
12         ReadExtendedHandshake func(*PeerConn, *pp.ExtendedHandshakeMessage)
13         PeerConnClosed        func(*PeerConn)
14 }