Skip to content

Commit

Permalink
fix(NetworkProtocol): udp code change, fixes #68
Browse files Browse the repository at this point in the history
BREAKING CHANGE

The new code for `udp` is 273.
  • Loading branch information
richardschneider committed Nov 29, 2018
1 parent 87b692f commit 3e26a9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/NetworkProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public override void WriteValue(CodedOutputStream stream)
class UdpNetworkProtocol : TcpNetworkProtocol
{
public override string Name { get { return "udp"; } }
public override uint Code { get { return 17; } }
public override uint Code { get { return 273; } }
}

class DccpNetworkProtocol : TcpNetworkProtocol
Expand Down
6 changes: 3 additions & 3 deletions test/MultiAddressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ public void Wire_Formats()
{
Assert.AreEqual(
new MultiAddress("/ip4/127.0.0.1/udp/1234").ToArray().ToHexString(),
"047f0000011104d2");
"047f000001910204d2");
Assert.AreEqual(
new MultiAddress("/ip4/127.0.0.1/udp/1234/ip4/127.0.0.1/tcp/4321").ToArray().ToHexString(),
"047f0000011104d2047f0000010610e1");
"047f000001910204d2047f0000010610e1");
Assert.AreEqual(
new MultiAddress("/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095").ToArray().ToHexString(),
"29200108a07ac542013ac986fffe317095");
Expand All @@ -228,7 +228,7 @@ public void Wire_Formats()
"a503221220d52ebb89d85b02a284948203a62ff28389c57c9f42beec4ec20db76a68911c0b");
Assert.AreEqual(
new MultiAddress("/ip4/127.0.0.1/udp/1234/utp").ToArray().ToHexString(),
"047f0000011104d2ae02");
"047f000001910204d2ae02");
Assert.AreEqual(
new MultiAddress("/onion/aaimaq4ygg2iegci:80").ToArray().ToHexString(),
"bc030010c0439831b48218480050");
Expand Down

0 comments on commit 3e26a9e

Please sign in to comment.