server/ipc/ipc_unix.go
crusader 79d5056b0f ing
2017-10-27 11:26:15 +09:00

21 lines
347 B
Go

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