From b6d2aeec8bd849c70028c01943968eba26474ea4 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 26 八月 2019 14:15:21 +0800 Subject: [PATCH] update shm --- profile/shmsend.go | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/profile/shmsend.go b/profile/shmsend.go index 61a3b87..2feca8b 100644 --- a/profile/shmsend.go +++ b/profile/shmsend.go @@ -22,6 +22,20 @@ return default: if err = s.Send(buf); err != nil { + s.Close() + url := "hello" + i, err := deliver.NewClientWithError(deliver.Shm, url) + for { + if err == nil { + break + } + time.Sleep(1 * time.Second) + i, err = deliver.NewClientWithError(deliver.Shm, url) + + fmt.Println("client create failed : ", err) + + } + s = i fmt.Printf("can't send message on push socket: %s\n", err.Error()) } else { -- Gitblit v1.8.0