introduce ProtocolSender interface

This commit is contained in:
Matthias Radestock committed 2015-01-20 23:41:42 +00:00
1 parent 76e44afdea
commit c6f5e7ec94
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ func (peer *LocalPeer) handleConnectionEstablished(conn *LocalConnection) {
func (peer *LocalPeer) handleSendProtocolMsg(m ProtocolMsg) { func (peer *LocalPeer) handleSendProtocolMsg(m ProtocolMsg) {
peer.ForEachConnection(func(_ PeerName, conn Connection) { peer.ForEachConnection(func(_ PeerName, conn Connection) {
conn.(*LocalConnection).SendProtocolMsg(m) conn.(ProtocolSender).SendProtocolMsg(m)
}) })
} }
+4
View File
@@ -21,3 +21,7 @@ type ProtocolMsg struct {
tag ProtocolTag tag ProtocolTag
msg []byte msg []byte
} }
type ProtocolSender interface {
SendProtocolMsg(m ProtocolMsg)
}