mirror of https://github.com/gorilla/websocket.git
Add (*Conn).WriteText(message string)
This commit is contained in:
parent
119002ce04
commit
592945ff2f
6
conn.go
6
conn.go
|
@ -493,6 +493,12 @@ func (c *Conn) WriteMessage(messageType int, data []byte) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WriteText writes given string with messageType TextMessage
|
||||||
|
// Is actually a shorthand for (*Conn).WriteMessage(websocket.TextMessage, []byte(message))
|
||||||
|
func (c *Conn) WriteText(message string) error {
|
||||||
|
return c.WriteMessage(TextMessage, []byte(message))
|
||||||
|
}
|
||||||
|
|
||||||
// SetWriteDeadline sets the deadline for future calls to NextWriter and the
|
// SetWriteDeadline sets the deadline for future calls to NextWriter and the
|
||||||
// io.WriteCloser returned from NextWriter. If the deadline is reached, the
|
// io.WriteCloser returned from NextWriter. If the deadline is reached, the
|
||||||
// call will fail with a timeout instead of blocking. A zero value for t means
|
// call will fail with a timeout instead of blocking. A zero value for t means
|
||||||
|
|
Loading…
Reference in New Issue