From f3bcf0ecd8f5b960ae63db3cee096ed7cffd39fb Mon Sep 17 00:00:00 2001 From: whiteCcinn <471113744@qq.com> Date: Mon, 24 May 2021 11:18:13 +0800 Subject: [PATCH] upgrade named-pipe-ipc version --- daemon.go | 4 ++-- example/named-pipe-ipc.go | 4 ++-- go.mod | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/daemon.go b/daemon.go index e46f140..47e2dbe 100644 --- a/daemon.go +++ b/daemon.go @@ -290,7 +290,7 @@ func (dctx *Context) Run(ctx context.Context) error { go func() { go func() { for { - msg, err := dctx.namedPipeCtx.Recv(false, '\n') + msg, err := dctx.namedPipeCtx.Recv(false) if err != nil && err.Error() != named_pipe_ipc.NoMessageMessage { dctx.log("[supervisor(%d)] [named-pipe-ipc] [err:%v]\n", dctx.Pid, err) os.Exit(4) @@ -320,7 +320,7 @@ func (dctx *Context) Run(ctx context.Context) error { } }() - err = dctx.namedPipeCtx.Listen('\n') + err = dctx.namedPipeCtx.Listen() if err != nil { dctx.log("[supervisor(%d)] [named-pipe-ipc start failed] [err:%v]\n", dctx.Pid, err) os.Exit(3) diff --git a/example/named-pipe-ipc.go b/example/named-pipe-ipc.go index 44d95cc..c22331b 100644 --- a/example/named-pipe-ipc.go +++ b/example/named-pipe-ipc.go @@ -23,8 +23,8 @@ func main() { log.Fatal(err) } - _, _ = nctx.Send(named_pipe_ipc.Message(string(data) + "\n")) - msg, err := nctx.Recv(true, '\n') + _, _ = nctx.Send(named_pipe_ipc.Message(string(data))) + msg, err := nctx.Recv(true) if err != nil { log.Fatal(err) } diff --git a/go.mod b/go.mod index e1ad0ec..dce85b9 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.15 require ( github.com/erikdubbelboer/gspt v0.0.0-20201015204752-6cb2489021da - github.com/whiteCcinn/named-pipe-ipc v0.0.2 + github.com/whiteCcinn/named-pipe-ipc v0.0.3 )