MCPcopy Index your code
hub / github.com/coder/websocket / SendBytes

Method SendBytes

internal/wsjs/wsjs_js.go:152–156  ·  view source on GitHub ↗

SendBytes sends the given message as a binary message on the WebSocket.

(v []byte)

Source from the content-addressed store, hash-verified

150// SendBytes sends the given message as a binary message
151// on the WebSocket.
152func (c WebSocket) SendBytes(v []byte) (err error) {
153 defer handleJSError(&err, nil)
154 c.v.Call("send", uint8Array(v))
155 return err
156}
157
158func extractArrayBuffer(arrayBuffer js.Value) []byte {
159 uint8Array := js.Global().Get("Uint8Array").New(arrayBuffer)

Callers 1

writeMethod · 0.80

Calls 2

handleJSErrorFunction · 0.85
uint8ArrayFunction · 0.85

Tested by

no test coverage detected