summaryrefslogtreecommitdiffhomepage
path: root/src/conn.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-19 13:35:17 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-19 13:35:17 +0100
commitaf464cff00fb9b78499cf4875d687bfa33e12082 (patch)
tree6cb4b40d0301e4fb924d56551661d48de740b2dc /src/conn.go
parentb5ae42349c4fd88022a63006060d72b03aa83b16 (diff)
Better naming of bind helpers
Diffstat (limited to 'src/conn.go')
-rw-r--r--src/conn.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/conn.go b/src/conn.go
index 5b40a23..b17ac70 100644
--- a/src/conn.go
+++ b/src/conn.go
@@ -54,7 +54,7 @@ func parseEndpoint(s string) (*net.UDPAddr, error) {
/* Must hold device and net lock
*/
-func unsafeCloseUDPListener(device *Device) error {
+func unsafeCloseBind(device *Device) error {
var err error
netc := &device.net
if netc.bind != nil {
@@ -64,8 +64,7 @@ func unsafeCloseUDPListener(device *Device) error {
return err
}
-// must inform all listeners
-func UpdateUDPListener(device *Device) error {
+func updateBind(device *Device) error {
device.mutex.Lock()
defer device.mutex.Unlock()
@@ -75,7 +74,7 @@ func UpdateUDPListener(device *Device) error {
// close existing sockets
- if err := unsafeCloseUDPListener(device); err != nil {
+ if err := unsafeCloseBind(device); err != nil {
return err
}
@@ -124,10 +123,10 @@ func UpdateUDPListener(device *Device) error {
return nil
}
-func CloseUDPListener(device *Device) error {
+func closeBind(device *Device) error {
device.mutex.Lock()
device.net.mutex.Lock()
- err := unsafeCloseUDPListener(device)
+ err := unsafeCloseBind(device)
device.net.mutex.Unlock()
device.mutex.Unlock()
return err