MCPcopy Create free account
hub / github.com/koding/kite / Send

Method Send

sockjsclient/sockjsclient.go:262–272  ·  view source on GitHub ↗

Send sends one text frame to session

(str string)

Source from the content-addressed store, hash-verified

260
261// Send sends one text frame to session
262func (w *WebsocketSession) Send(str string) error {
263 if atomic.LoadInt32(&w.closed) == 1 {
264 return ErrSessionClosed
265 }
266
267 w.mu.Lock()
268 defer w.mu.Unlock()
269
270 b, _ := json.Marshal([]string{str})
271 return w.conn.WriteMessage(websocket.TextMessage, b)
272}
273
274// Close closes the session with provided code and reason.
275func (w *WebsocketSession) Close(uint32, string) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected