introduce ProtocolSender interface
This commit is contained in:
1 parent
76e44afdea
commit
c6f5e7ec94
2 files changed
+5
-1
No files matched your search
@@ -250,7 +250,7 @@ func (peer *LocalPeer) handleConnectionEstablished(conn *LocalConnection) {
|
||||
|
||||
func (peer *LocalPeer) handleSendProtocolMsg(m ProtocolMsg) {
|
||||
peer.ForEachConnection(func(_ PeerName, conn Connection) {
|
||||
conn.(*LocalConnection).SendProtocolMsg(m)
|
||||
conn.(ProtocolSender).SendProtocolMsg(m)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,3 +21,7 @@ type ProtocolMsg struct {
|
||||
tag ProtocolTag
|
||||
msg []byte
|
||||
}
|
||||
|
||||
type ProtocolSender interface {
|
||||
SendProtocolMsg(m ProtocolMsg)
|
||||
}
|
||||
Reference in new issue
Block a user