From aaae9917c3df122e2bbcf591417c1b58021d79fc Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期三, 15 五月 2019 16:58:03 +0800 Subject: [PATCH] add close --- nng.go | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/nng.go b/nng.go index 00a8dc2..61b5e76 100644 --- a/nng.go +++ b/nng.go @@ -58,6 +58,13 @@ return n.sock.Recv() } +// Close impl interface Deliver +func (n *NNG) Close() { + if n.sock != nil { + n.sock.Close() + } +} + // nngProducer create from deliver Mode func nngProducer(m Mode, url string, args ...interface{}) *NNG { -- Gitblit v1.8.0