Send unicast to selected peer, have windows see multiple instances (and pass the new discovery tests)#19
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
===========================================
+ Coverage 32.75% 54.59% +21.83%
===========================================
Files 9 9
Lines 693 784 +91
===========================================
+ Hits 227 428 +201
+ Misses 458 314 -144
- Partials 8 42 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements unicast messaging to enable direct peer-to-peer connections after multicast discovery. The changes introduce a connection management system where peers can initiate direct UDP connections to each other, supplementing the existing multicast discovery mechanism.
Key Changes:
- Added unicast receiver alongside multicast for handling direct peer connections
- Implemented connection request/response protocol with connection state tracking
- Created comprehensive test suite for peer discovery and multi-peer scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tsnet/tsnet.go | Core implementation of unicast messaging, connection management, and protocol message formats |
| tsnet/tsnet_test.go | New test file with peer discovery and multi-peer connection tests |
| main.go | Integration of ConnectToPeer functionality with user input |
| WARP.md | Documentation update describing the new connection capabilities |
Comments suppressed due to low confidence (1)
tsnet/tsnet.go:1
- Variable shadowing:
expectedis declared twice in this test function (lines 185 and 209), which could lead to confusion. The second declaration should use a different name likeexpectedPeers.
// Package tsnet is the network library support for tsync (discovery/registration and communication).
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| AcceptMessageFormat = "accept1 %q" // target_name | ||
| RejectMessageFormat = "reject1 %q %q" // target_name, reason | ||
| DataMessageFormat = "data1 %q %s" // target_name, signed_data |
There was a problem hiding this comment.
Several message formats (AcceptMessageFormat, RejectMessageFormat, DataMessageFormat) are defined but never used in the codebase. Consider removing unused constants or implementing the corresponding message handlers if they're planned for future use.
| AcceptMessageFormat = "accept1 %q" // target_name | |
| RejectMessageFormat = "reject1 %q %q" // target_name, reason | |
| DataMessageFormat = "data1 %q %s" // target_name, signed_data |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
No description provided.