migrating rpc command to package.

This commit is contained in:
greg stone
2023-02-23 11:40:28 +00:00
parent 23ed87ceb0
commit d2f2ca7911
5 changed files with 82 additions and 54 deletions

View File

@@ -3,6 +3,7 @@ package rpc
import (
"google.golang.org/grpc"
"net"
"os"
)
var (
@@ -17,7 +18,7 @@ func startUnixSocket(srv *grpc.Server) (err error) {
return
}
if unixSock, err = net.Listen("unix", unixPath); check(err) {
if unixSock, err = net.Listen("unix", unixPath); err != nil {
return
}
@@ -32,13 +33,13 @@ func stopUnixSocket() (err error) {
return
}
if err = unixSock.Close(); check(err) {
// continue
if unixSock != nil {
if err = unixSock.Close(); check(err) {
// continue
}
}
//if err = os.Remove(unixPath); check(err) {
// // continue
//}
os.Remove(unixPath)
return
}