Skip to content

v2.0.3

Latest
Compare
Choose a tag to compare
@georg-jung georg-jung released this 13 Jul 16:10

Breaking Changes

  • In version 1.x, when calling Lookup or LookupAsync on Windows and no MAC address could be associated with the given IP adress (i.e. if the IP is not on the same subnet), a Win32Exception with NativeErrorCode == 67 (ERROR_BAD_NET_NAME) was thrown.
    • This was inconsistent with our docs, which state <returns>The mac address if found, null otherwise.</returns>.
    • This was different then what the Linux version did, which sticks to what the docs say.
    • For a method called Lookup, that provides internals about a network that might change, it feels natural that "I did not find a result" is not a result that is exceptional. Rather, the return value is of type PhysicalAddress? and thus expresses "an address might be found".
    • As what was throwing before (and thus needed to be handled i.e. by catch), returns null now (=> needs to be handled i.e. by if), this is a breaking change.

Upgrading

Change code that might be run on Windows and does something comparable to

try
{
    var x = Arp.Lookup(IPAddress.Parse("128.0.0.1"));
    // found
}
catch (Win32Exception ex)
when (ex.NativeErrorCode == 67)
{
    // not found
}

to something like

var x = Arp.Lookup(IPAddress.Parse("128.0.0.1"));
if (x == null)
{
    // not found
}
else
{
    // found
}

Changes:

  • d3f5194 Set version to '2.0'
  • 9d32f2a Improve/clarify library description
  • e486ad8 Return null on Windows if address could not be found [ #7 ]
  • 6c69171 Format/markdownlint README.md
  • cd2fbb8 remove code that was based on nikeee/wake-on-lan
  • 0c2745f Merge branch 'release/v1.2'
  • 9bc65f1 Set version to '1.3-alpha'

This list of changes was auto generated.