From 9a89af693b9336633bcac2a652c294f782e6b3b1 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期一, 20 五月 2019 12:54:50 +0800
Subject: [PATCH] add share memory improve effect

---
 nng.go |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/nng.go b/nng.go
index 1e9c1c0..751feac 100644
--- a/nng.go
+++ b/nng.go
@@ -21,20 +21,12 @@
 	"nanomsg.org/go-mangos/transport/all"
 )
 
-// type deliver
-type td int
-
-const (
-	agent = td(iota)
-	coactee
-)
-
 // NNG mangos wrap
 type NNG struct {
-	sock   mangos.Socket
-	server bool
-	mode   Mode
-	url    string
+	sock mangos.Socket
+	typ  td
+	mode Mode
+	url  string
 
 	arguments []interface{}
 }
@@ -93,7 +85,7 @@
 	rmExistedIpcName(url)
 
 	return &NNG{
-		server:    true,
+		typ:       agent,
 		mode:      m,
 		url:       url,
 		arguments: args,
@@ -103,7 +95,7 @@
 func nngClient(m Mode, url string, args ...interface{}) *NNG {
 
 	return &NNG{
-		server:    false,
+		typ:       coactee,
 		mode:      m,
 		url:       url,
 		arguments: args,

--
Gitblit v1.8.0