]> Sergey Matveev's repositories - btrtrc.git/blobdiff - callbacks.go
Add some client callbacks
[btrtrc.git] / callbacks.go
diff --git a/callbacks.go b/callbacks.go
new file mode 100644 (file)
index 0000000..e603997
--- /dev/null
@@ -0,0 +1,12 @@
+package torrent
+
+import (
+       pp "github.com/anacrolix/torrent/peer_protocol"
+)
+
+// These are called synchronously, and do not pass ownership. The Client and other locks may still
+// be held. nil functions are not called.
+type Callbacks struct {
+       CompletedHandshake func(_ *PeerConn, infoHash InfoHash)
+       ReadMessage        func(*PeerConn, *pp.Message)
+}