Add unreliable protocol family

parent 8f444fbd
......@@ -18,6 +18,9 @@ var UDP = And(IP, Base(ma.P_UDP))
// Define UTP as 'utp' on top of udp (on top of ipv4 or ipv6)
var UTP = And(UDP, Base(ma.P_UTP))
// Define unreliable transport as udp
var Unreliable = Or(UDP)
// Now define a Reliable transport as either tcp or utp
var Reliable = Or(TCP, UTP)
......
......@@ -110,6 +110,9 @@ func TestBasicMatching(t *testing.T) {
assertMatches(t, Reliable, good_utp, good_tcp)
assertMismatches(t, Reliable, good_ip, good_udp, good_ipfs)
assertMatches(t, Unreliable, good_udp)
assertMismatches(t, Unreliable, good_ip, good_tcp, good_utp, good_ipfs)
assertMatches(t, IPFS, good_ipfs)
assertMismatches(t, IPFS, bad_ipfs, good_ip, good_tcp, good_utp, good_udp)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment