WriteBytesBinary is a shorthand for c.WriteMessage(websocket.BinaryMessage, b).
(b []byte)
| 436 | |
| 437 | // WriteBytesBinary is a shorthand for c.WriteMessage(websocket.BinaryMessage, b). |
| 438 | func (ws *Websocket) WriteBytesBinary(b []byte) *Websocket { |
| 439 | opChain := ws.chain.enter("WriteBytesBinary()") |
| 440 | defer opChain.leave() |
| 441 | |
| 442 | if ws.checkUnusable(opChain, "WriteBytesBinary()") { |
| 443 | return ws |
| 444 | } |
| 445 | |
| 446 | ws.writeMessage(opChain, websocket.BinaryMessage, b) |
| 447 | |
| 448 | return ws |
| 449 | } |
| 450 | |
| 451 | // WriteBytesText is a shorthand for c.WriteMessage(websocket.TextMessage, b). |
| 452 | func (ws *Websocket) WriteBytesText(b []byte) *Websocket { |