This commit is contained in:
crusader 2018-03-22 23:17:20 +09:00
parent 2350199b7c
commit a1cd140c1a

View File

@ -4,6 +4,8 @@ import (
"net" "net"
"sync" "sync"
"time" "time"
"git.loafle.net/commons_go/logging"
) )
type Socket interface { type Socket interface {
@ -47,6 +49,19 @@ func (s *netSocket) ID() string {
return s.id 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 { func (s *netSocket) Close() error {
err := s.Conn.Close() err := s.Conn.Close()
releaseSocket(s) releaseSocket(s)