From 5e42fbc185bd1598d500a9eb5d34be17b98b1f20 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 13 Apr 2018 19:13:37 +0900 Subject: [PATCH] ing --- socket/readwrite.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/socket/readwrite.go b/socket/readwrite.go index b7e2308..b2cc7d5 100644 --- a/socket/readwrite.go +++ b/socket/readwrite.go @@ -4,6 +4,8 @@ import ( "fmt" "io" "time" + + logging "git.loafle.net/commons/logging-go" ) func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-chan struct{}, doneChan chan<- error, readChan chan<- []byte) { @@ -53,6 +55,7 @@ func connReadHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-ch if IsUnexpectedCloseError(err, CloseGoingAway, CloseAbnormalClosure) { err = fmt.Errorf("Read error %v", err) } + logging.Logger().Debug(err) return } @@ -91,11 +94,13 @@ func connWriteHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-c wc, err = conn.NextWriter(TextMessage) if err != nil { + logging.Logger().Debug(err) return } wc.Write(message) if err = wc.Close(); nil != err { + logging.Logger().Debug(err) return } case <-ticker.C: @@ -105,6 +110,7 @@ func connWriteHandler(readWriteHandler ReadWriteHandler, conn Conn, stopChan <-c conn.SetWriteDeadline(time.Time{}) } if err = conn.WriteMessage(PingMessage, nil); nil != err { + logging.Logger().Debug(err) return } case <-stopChan: