From a1cd140c1af89eba0ae44bdf957a3ad193cc8e32 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 22 Mar 2018 23:17:20 +0900 Subject: [PATCH] ing --- socket.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/socket.go b/socket.go index d8294fd..1386a69 100644 --- a/socket.go +++ b/socket.go @@ -4,6 +4,8 @@ import ( "net" "sync" "time" + + "git.loafle.net/commons_go/logging" ) type Socket interface { @@ -47,6 +49,19 @@ func (s *netSocket) ID() string { return s.id } +func (s *netSocket) Read(b []byte) (n int, err error) { + n, err = s.Conn.Read(b) + + logging.Logger().Debugf("Server Socket: read message[%s]", string(b)) + + return +} + +func (s *netSocket) Write(b []byte) (n int, err error) { + logging.Logger().Debugf("Server Socket: write message[%s]", string(b)) + return s.Conn.Write(b) +} + func (s *netSocket) Close() error { err := s.Conn.Close() releaseSocket(s)