MCPcopy
hub / github.com/WireGuard/wireguard-go / closeBindLocked

Function closeBindLocked

device/device.go:425–436  ·  view source on GitHub ↗

closeBindLocked closes the device's net.bind. The caller must hold the net mutex.

(device *Device)

Source from the content-addressed store, hash-verified

423// closeBindLocked closes the device's net.bind.
424// The caller must hold the net mutex.
425func closeBindLocked(device *Device) error {
426 var err error
427 netc := &device.net
428 if netc.netlinkCancel != nil {
429 netc.netlinkCancel.Cancel()
430 }
431 if netc.bind != nil {
432 err = netc.bind.Close()
433 }
434 netc.stopping.Wait()
435 return err
436}
437
438func (device *Device) Bind() conn.Bind {
439 device.net.Lock()

Callers 2

BindUpdateMethod · 0.85
BindCloseMethod · 0.85

Calls 3

WaitMethod · 0.80
CloseMethod · 0.65
CancelMethod · 0.45

Tested by

no test coverage detected