From dd22fdb1c82ae93446f5e1166d500331c0ad6a1d Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期一, 29 七月 2019 13:52:16 +0800 Subject: [PATCH] add timeout interface --- nngopt.go | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/nngopt.go b/nngopt.go index 0ffb761..bd7aa65 100644 --- a/nngopt.go +++ b/nngopt.go @@ -10,10 +10,14 @@ var ( maxRecvSize = 33 * 1024 * 1024 surveyorTime = 0 + timeout = time.Duration(25) ) +func setTimeOut(tm int) { + timeout = time.Duration(tm) +} + func optDefault() map[string]interface{} { - timeout := time.Duration(25) options := make(map[string]interface{}) -- Gitblit v1.8.0