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