From c9e95df0df5e4050bd7e986768aef58163d9ba85 Mon Sep 17 00:00:00 2001 From: mappu Date: Mon, 4 Apr 2016 19:01:47 +1200 Subject: [PATCH] libnmdc: fix for previous --- src/libnmdc/libnmdc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libnmdc/libnmdc.go b/src/libnmdc/libnmdc.go index f6cd88d..fd94341 100644 --- a/src/libnmdc/libnmdc.go +++ b/src/libnmdc/libnmdc.go @@ -13,9 +13,9 @@ import ( ) const ( - DEFAULT_CLIENT_TAG string = "libnmdc.go" - DEFAULT_HUB_NAME string = "(unknown)" - SEND_KEEPALIVE_EVERY_SECONDS int = 29 + DEFAULT_CLIENT_TAG string = "libnmdc.go" + DEFAULT_HUB_NAME string = "(unknown)" + SEND_KEEPALIVE_EVERY time.Duration = 29 * time.Second ) type ConnectionState int @@ -371,7 +371,7 @@ func (this *HubConnection) worker() { // Read from socket into our local buffer (blocking) if this.connValid { readBuff := make([]byte, 1024) - this.conn.SetReadDeadline(time.Now().Add(SEND_KEEPALIVE_EVERY_SECONDS * time.Second)) + this.conn.SetReadDeadline(time.Now().Add(SEND_KEEPALIVE_EVERY)) nbytes, err = this.conn.Read(readBuff) if err != nil && err.(net.Error).Timeout() {