Commit 3a232aa
committed
interop: unify peer socket address response streaming in TestServiceImpl
Refactor `fullDuplexCall` in `TestServiceImpl` to route peer socket address
requests through the `toChunkQueue()` pipeline and the `ResponseDispatcher`.
This replaces the previous approach of manually branching and bypassing
the standard chunk streaming flow.
Specifically:
- Retrieve the peer's socket address on the request-handling thread inside
`toChunkQueue()` to prevent context loss on the background scheduling thread.
- Overload the `Chunk` class constructor to accept a nullable `peerSocketAddress`
while keeping the default constructor for backward compatibility.
- Ensure `Chunk.toResponse()` only populates the response `payload` field if
`length > 0`, preserving the exact wire-format for empty/address-only requests.
- Remove the manual branch on `whetherSendClientSocketAddressInResponse` and its
associated helper method, simplifying `fullDuplexCall`.1 parent 657c929 commit 3a232aa
1 file changed
Lines changed: 21 additions & 23 deletions
Lines changed: 21 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 243 | | |
251 | 244 | | |
252 | 245 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | 246 | | |
265 | 247 | | |
266 | 248 | | |
| |||
466 | 448 | | |
467 | 449 | | |
468 | 450 | | |
469 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
470 | 457 | | |
471 | 458 | | |
472 | 459 | | |
| |||
484 | 471 | | |
485 | 472 | | |
486 | 473 | | |
| 474 | + | |
487 | 475 | | |
488 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
489 | 481 | | |
490 | 482 | | |
491 | 483 | | |
| 484 | + | |
492 | 485 | | |
493 | 486 | | |
494 | 487 | | |
| |||
497 | 490 | | |
498 | 491 | | |
499 | 492 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
504 | 502 | | |
505 | 503 | | |
506 | 504 | | |
| |||
0 commit comments