ing
This commit is contained in:
parent
3e7ee505b4
commit
86a48a1e2b
15
socket.go
15
socket.go
|
@ -193,6 +193,21 @@ func (s *fasthttpWebSocket) WriteMessage(messageType int, data []byte) error {
|
|||
return s.Conn.WriteMessage(messageType, data)
|
||||
}
|
||||
|
||||
func (s *fasthttpWebSocket) WriteMessageUseWriter(messageType int, data []byte) error {
|
||||
wc, err := s.NextWriter(messageType)
|
||||
if nil != err {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
wc.Close()
|
||||
}()
|
||||
|
||||
_, err = wc.Write(data)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *fasthttpWebSocket) Close() error {
|
||||
err := s.Conn.Close()
|
||||
releaseSocket(s)
|
||||
|
|
Loading…
Reference in New Issue
Block a user