From 57a60490c6d116c600a96b7acb22fca90d9cad70 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 29 Nov 2017 20:13:37 +0900 Subject: [PATCH] ing --- socket.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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()