Finer-grained start-stop synchronization
This commit is contained in:
parent
23eca94508
commit
846d721dfd
6 changed files with 33 additions and 5 deletions
6
conn.go
6
conn.go
|
|
@ -12,6 +12,10 @@ import (
|
|||
"net"
|
||||
)
|
||||
|
||||
const (
|
||||
ConnRoutineNumber = 2
|
||||
)
|
||||
|
||||
/* A Bind handles listening on a port for both IPv6 and IPv4 UDP traffic
|
||||
*/
|
||||
type Bind interface {
|
||||
|
|
@ -153,6 +157,8 @@ func (device *Device) BindUpdate() error {
|
|||
|
||||
// start receiving routines
|
||||
|
||||
device.state.starting.Add(ConnRoutineNumber)
|
||||
device.state.stopping.Add(ConnRoutineNumber)
|
||||
go device.RoutineReceiveIncoming(ipv4.Version, netc.bind)
|
||||
go device.RoutineReceiveIncoming(ipv6.Version, netc.bind)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue