diff --git a/socket.go b/socket.go index 6a488a8..624723d 100644 --- a/socket.go +++ b/socket.go @@ -202,21 +202,21 @@ func (s *fasthttpWebSocket) ID() string { // return s.sc, nil // } -// func (s *fasthttpWebSocket) NextWriter(messageType int) (io.WriteCloser, error) { -// if 0 < s.sh.GetWriteTimeout() { -// s.SetWriteDeadline(time.Now().Add(s.sh.GetWriteTimeout() * time.Second)) -// } +func (s *fasthttpWebSocket) NextWriter(messageType int) (io.WriteCloser, error) { + if 0 < s.sh.GetWriteTimeout() { + s.SetWriteDeadline(time.Now().Add(s.sh.GetWriteTimeout() * time.Second)) + } -// return s.Conn.NextWriter(messageType) -// } + return s.Conn.NextWriter(messageType) +} -// func (s *fasthttpWebSocket) WriteMessage(messageType int, data []byte) error { -// if 0 < s.sh.GetWriteTimeout() { -// s.SetWriteDeadline(time.Now().Add(s.sh.GetWriteTimeout() * time.Second)) -// } +func (s *fasthttpWebSocket) WriteMessage(messageType int, data []byte) error { + if 0 < s.sh.GetWriteTimeout() { + s.SetWriteDeadline(time.Now().Add(s.sh.GetWriteTimeout() * time.Second)) + } -// return s.Conn.WriteMessage(messageType, data) -// } + return s.Conn.WriteMessage(messageType, data) +} func (s *fasthttpWebSocket) Close() error { err := s.Conn.Close()