Write writes a message to the connection. See the Writer method if you want to stream a message. If compression is disabled or the compression threshold is not met, then it will write the message in a single frame.
(ctx context.Context, typ MessageType, p []byte)
| 41 | // If compression is disabled or the compression threshold is not met, then it |
| 42 | // will write the message in a single frame. |
| 43 | func (c *Conn) Write(ctx context.Context, typ MessageType, p []byte) error { |
| 44 | _, err := c.write(ctx, typ, p) |
| 45 | if err != nil { |
| 46 | return fmt.Errorf("failed to write msg: %w", err) |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | type msgWriter struct { |
| 52 | c *Conn |
no test coverage detected