libnmdc: fix for previous

This commit is contained in:
mappu 2016-04-04 19:01:47 +12:00
parent a2b94e8724
commit c9e95df0df
1 changed files with 4 additions and 4 deletions

View File

@ -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() {