ing
This commit is contained in:
parent
2350199b7c
commit
a1cd140c1a
15
socket.go
15
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user