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)