MCPcopy
hub / github.com/coder/websocket / Close

Method Close

ws_js.go:378–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376}
377
378func (w *writer) Close() error {
379 if w.closed {
380 return errors.New("cannot close closed writer")
381 }
382 w.closed = true
383 defer bpool.Put(w.b)
384
385 err := w.c.Write(w.ctx, w.typ, w.b.Bytes())
386 if err != nil {
387 return fmt.Errorf("failed to close writer: %w", err)
388 }
389 return nil
390}
391
392// CloseRead implements *Conn.CloseRead for wasm.
393func (c *Conn) CloseRead(ctx context.Context) context.Context {

Callers

nothing calls this directly

Calls 2

PutFunction · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected