Work on timer teardown + bug fixes
Added waitgroups to peer struct for routine start / stop synchronisation
This commit is contained in:
parent
d73f960aab
commit
1dd590b91b
8 changed files with 102 additions and 47 deletions
11
src/conn.go
11
src/conn.go
|
|
@ -64,13 +64,9 @@ func unsafeCloseBind(device *Device) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func updateBind(device *Device) error {
|
||||
device.mutex.Lock()
|
||||
defer device.mutex.Unlock()
|
||||
|
||||
netc := &device.net
|
||||
netc.mutex.Lock()
|
||||
defer netc.mutex.Unlock()
|
||||
/* Must hold device and net lock
|
||||
*/
|
||||
func unsafeUpdateBind(device *Device) error {
|
||||
|
||||
// close existing sockets
|
||||
|
||||
|
|
@ -89,6 +85,7 @@ func updateBind(device *Device) error {
|
|||
// bind to new port
|
||||
|
||||
var err error
|
||||
netc := &device.net
|
||||
netc.bind, netc.port, err = CreateBind(netc.port)
|
||||
if err != nil {
|
||||
netc.bind = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue