This commit is contained in:
crusader 2017-11-29 19:42:12 +09:00
parent 27ca509636
commit 1d6e7bc5b3

View File

@ -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()