overflow_discovery/server/server_handlers_unix.go
crusader 2b154aeb87 ing
2017-11-29 14:19:36 +09:00

18 lines
327 B
Go

package server
import (
"net"
"os"
"git.loafle.net/commons_go/server"
)
func (sh *ServerHandlers) Listen(serverCTX server.ServerContext) (net.Listener, error) {
os.Remove(sh.addr)
l, err := net.ListenUnix("unix", &net.UnixAddr{Name: sh.addr, Net: "unix"})
if nil == err {
os.Chmod(sh.addr, 0777)
}
return l, err
}