17 lines
304 B
Go
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"})
|
||
|
}
|