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