I was working with some simple server client socket code in a Godot 3 application. For some reason, when I use this code:
IPAddress ipa = System.Net.IPAddress.Parse("131.236.053.199");
and print the result to the console via Console.WriteLine(ipa.ToString());
I get:
131.236.43.199
If I remove the leading zero from the 3rd byte and execute this line:
IPAddress ipa = System.Net.IPAddress.Parse("131.236.53.199");
and print the result via Console.WriteLine(ipa.ToString());
I get the desired address:
and print the result to the console I get:
131.236.53.199
Is there a reason why does the leading zero makes a difference? Is this a bug in the Microsoft code or am I missing something else?
I've read the documentation at https://msdn.microsoft.com/en-us/library/system.net.ipaddress.parse(v=vs.110).aspx and couldn't see why this behaviour would occur.
Thanks.