2017-10-26 12:30:55 +00:00
|
|
|
package ipc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
2017-10-27 02:16:09 +00:00
|
|
|
"os"
|
2017-10-26 12:30:55 +00:00
|
|
|
)
|
|
|
|
|
2017-10-27 02:16:09 +00:00
|
|
|
func (sh *ServerHandlers) Listen() (l net.Listener, err error) {
|
2017-10-27 02:01:53 +00:00
|
|
|
//sh.path = filepath.Join(os.TempDir(), sh.Addr)
|
|
|
|
// os.Remove(sh.path)
|
2017-10-27 02:16:09 +00:00
|
|
|
l, err = net.ListenUnix("unix", &net.UnixAddr{Name: sh.Addr, Net: "unix"})
|
2017-10-26 12:30:55 +00:00
|
|
|
|
2017-10-27 02:21:27 +00:00
|
|
|
os.Chmod(sh.Addr, 0777)
|
2017-10-27 02:16:09 +00:00
|
|
|
|
|
|
|
return
|
2017-10-26 12:30:55 +00:00
|
|
|
}
|
2017-10-26 12:34:15 +00:00
|
|
|
|
|
|
|
func (sh *ServerHandlers) Stopped() {
|
2017-10-27 02:01:53 +00:00
|
|
|
// os.Remove(sh.path)
|
2017-10-26 12:34:15 +00:00
|
|
|
}
|