Commit 2a5e1d7
Propagate caller-triggered cancellation in transport exception handling
Cherry-pick from halter73/transport-exceptions (fd2d71e, 19a1f2c):
- StreamClientSessionTransport.SendMessageAsync: re-throw
OperationCanceledException when the caller's token triggers it,
instead of wrapping in IOException.
- StreamServerTransport.SendMessageAsync: same pattern.
- SseClientSessionTransport.ConnectAsync: add OperationCanceledException
guard and change InvalidOperationException to IOException for
consistency (connection failure is I/O, not invalid state).
Co-authored-by: Stephen Halter <halter73@gmail.com>
Agent-Logs-Url: https://github.com/modelcontextprotocol/csharp-sdk/sessions/f1ba1333-443c-4239-8205-c32db49e9f22
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>1 parent 4983cfb commit 2a5e1d7
File tree
3 files changed
+13
-1
lines changed- src/ModelContextProtocol.Core
- Client
- Server
3 files changed
+13
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | | - | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
0 commit comments