server/ipc/ipc_unix.go
crusader 187ef708f6 ing
2017-10-26 21:30:55 +09:00

17 lines
304 B
Go

package ipc
import (
"net"
"os"
"path/filepath"
)
func (sh *ServerHandlers) Listen() (net.Listener, error) {
sh.path = filepath.Join(os.TempDir(), sh.Addr)
if err := os.Remove(sh.path); nil != err {
return nil, err
}
return net.ListenUnix("unix", &net.UnixAddr{Name: sh.path, Net: "unix"})
}