-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change type of Peer.EndPoint to DnsEndPoint #166
Conversation
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
==========================================
- Coverage 87.04% 83.93% -3.11%
==========================================
Files 71 71
Lines 3226 3243 +17
==========================================
- Hits 2808 2722 -86
- Misses 418 521 +103
|
@dahlia @earlbread I've amend the commit to cover |
I've append another bug fix. |
@@ -75,7 +76,7 @@ public partial class Swarm : ICollection<Peer>, IDisposable | |||
public Swarm( | |||
PrivateKey privateKey, | |||
TimeSpan dialTimeout, | |||
IPAddress ipAddress = null, | |||
string host = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if an invalid address is passed? Does the constructor throw an exception, or merely Swarm
crashes at unspecified moments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither. Swarm
will advertise the address as its endpoint, and as a result will be isolated from the network.
Do we need to check connectability? (It's probably hard on the constructor, and it's possible in StartAsync()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it would good to have basic validations on the given ipAddress
, at this point we necessarily need that IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
host
can be an IP address, but it can also be any host name. so I think it is a bit tricky to check here statically.
…A1002 Enable LAA1002 rule
This PR changes
Peer.EndPoint
's type toDnsEndPoint
to resolve #165.In this process, I've found a problem that the node behind the NAT can't connect properly, but I will treat it as a separate issue.