Read implements the [Connection] interface.
(ctx context.Context)
| 1762 | |
| 1763 | // Read implements the [Connection] interface. |
| 1764 | func (c *streamableClientConn) Read(ctx context.Context) (jsonrpc.Message, error) { |
| 1765 | if err := c.failure(); err != nil { |
| 1766 | return nil, err |
| 1767 | } |
| 1768 | select { |
| 1769 | case <-ctx.Done(): |
| 1770 | return nil, ctx.Err() |
| 1771 | case <-c.failed: |
| 1772 | return nil, c.failure() |
| 1773 | case <-c.done: |
| 1774 | return nil, io.EOF |
| 1775 | case msg := <-c.incoming: |
| 1776 | return msg, nil |
| 1777 | } |
| 1778 | } |
| 1779 | |
| 1780 | // Write implements the [Connection] interface. |
| 1781 | func (c *streamableClientConn) Write(ctx context.Context, msg jsonrpc.Message) error { |