Fix bugs related to needing to send Broadcast
This commit is contained in:
parent
7b1f5584ab
commit
ca18089382
@ -326,7 +326,7 @@ func (t *tun) process() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check the multicast mappings
|
// check the multicast mappings
|
||||||
if msg.mode > Unicast {
|
if msg.mode == Multicast {
|
||||||
link.RLock()
|
link.RLock()
|
||||||
_, ok := link.channels[msg.channel]
|
_, ok := link.channels[msg.channel]
|
||||||
link.RUnlock()
|
link.RUnlock()
|
||||||
|
@ -125,7 +125,7 @@ func (s *session) Open() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't wait on multicast/broadcast
|
// don't wait on multicast/broadcast
|
||||||
if s.mode > Unicast {
|
if s.mode == Multicast {
|
||||||
s.accepted = true
|
s.accepted = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ func (s *session) Accept() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// don't wait on multicast/broadcast
|
// don't wait on multicast/broadcast
|
||||||
if s.mode > Unicast {
|
if s.mode == Multicast {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ func (s *session) Send(m *transport.Message) error {
|
|||||||
msg.data = data
|
msg.data = data
|
||||||
|
|
||||||
// if multicast don't set the link
|
// if multicast don't set the link
|
||||||
if s.mode > Unicast {
|
if s.mode == Multicast {
|
||||||
msg.link = ""
|
msg.link = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// send over one link
|
||||||
Unicast Mode = iota
|
Unicast Mode = iota
|
||||||
|
// send to all channel listeners
|
||||||
Multicast
|
Multicast
|
||||||
|
// send to all listeners
|
||||||
Broadcast
|
Broadcast
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,6 +28,7 @@ var (
|
|||||||
ErrLinkNotFound = errors.New("link not found")
|
ErrLinkNotFound = errors.New("link not found")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Mode of the session
|
||||||
type Mode uint8
|
type Mode uint8
|
||||||
|
|
||||||
// Tunnel creates a gre tunnel on top of the go-micro/transport.
|
// Tunnel creates a gre tunnel on top of the go-micro/transport.
|
||||||
|
Loading…
Reference in New Issue
Block a user