Implement TCP connection (tcpConn)#390
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #390 +/- ##
==========================================
- Coverage 84.11% 83.61% -0.51%
==========================================
Files 41 41
Lines 3356 3612 +256
==========================================
+ Hits 2823 3020 +197
- Misses 395 437 +42
- Partials 138 155 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial vnet.TCPConn implementation intended to satisfy transport.TCPConn / net.Conn semantics inside the vnet simulator, along with unit tests for core I/O and teardown behaviors. It also standardizes timeout errors by switching to a shared errIOTimeout instance.
Changes:
- Implement
TCPConnread/write paths with simple seq/ack-based blocking semantics, plus close and deadline handling. - Add a comprehensive new
tcp_conn_test.gosuite covering reads, writes, deadlines, close behavior, and RST handling. - Replace per-call timeout error construction with a reusable
errIOTimeout.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| vnet/tcp_conn.go | Adds the TCPConn implementation (I/O, close, deadlines) and inbound segment handling. |
| vnet/tcp_conn_test.go | Adds unit tests for TCPConn data flow, deadlines, shutdown, and RST behavior. |
| vnet/errors.go | Introduces errIOTimeout global to replace newTimeoutError. |
| vnet/conn.go | Updates UDPConn timeout path to use errIOTimeout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a02ddb6 to
7c48263
Compare
0643a48 to
12d687d
Compare
Add
tcpConntype that implementstransport.TCPConn/net.Conn.Read/Writewith in-order delivery usingseqNum/ackNum.Closewith FIN/RST handling.SetDeadline,SetReadDeadline,SetWriteDeadline.Split out from #375