()
| 320 | } |
| 321 | |
| 322 | func (w *wsResponseWriter) start() error { |
| 323 | w.mu.Lock() |
| 324 | defer w.mu.Unlock() |
| 325 | if w.started { |
| 326 | return nil |
| 327 | } |
| 328 | w.started = true |
| 329 | return w.sink.start(101, "", http.Header{}) |
| 330 | } |
| 331 | |
| 332 | func (w *wsResponseWriter) SendText(data []byte) error { |
| 333 | w.mu.Lock() |