Commit 78e9af52 authored by Luke Champine's avatar Luke Champine

add network locks

parent c9a2be77
......@@ -39,6 +39,8 @@ type TCPServer struct {
// Address returns the Address of the server.
func (tcps *TCPServer) Address() Address {
tcps.RLock()
defer tcps.RUnlock()
return tcps.myAddr
}
......@@ -63,7 +65,9 @@ func (tcps *TCPServer) setHostname(host string) bool {
if !Ping(newAddr) {
return false
}
tcps.Lock()
tcps.myAddr = newAddr
tcps.Unlock()
return true
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment