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

Method Writer

write.go:29–35  ·  view source on GitHub ↗

Writer returns a writer bounded by the context that will write a WebSocket message of type dataType to the connection. You must close the writer once you have written the entire message. Only one writer can be open at a time, multiple calls will block until the previous writer is closed.

(ctx context.Context, typ MessageType)

Source from the content-addressed store, hash-verified

27// Only one writer can be open at a time, multiple calls will block until the previous writer
28// is closed.
29func (c *Conn) Writer(ctx context.Context, typ MessageType) (io.WriteCloser, error) {
30 w, err := c.writer(ctx, typ)
31 if err != nil {
32 return nil, fmt.Errorf("failed to get writer: %w", err)
33 }
34 return w, nil
35}
36
37// Write writes a message to the connection.
38//

Callers

nothing calls this directly

Calls 1

writerMethod · 0.95

Tested by

no test coverage detected