Send sends one text frame to session
(str string)
| 260 | |
| 261 | // Send sends one text frame to session |
| 262 | func (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. |
| 275 | func (w *WebsocketSession) Close(uint32, string) error { |
nothing calls this directly
no outgoing calls
no test coverage detected