{"push_id":998908154,"size":1,"distinct_size":1,"ref":"refs/heads/socket_error_values","head":"be3c1e59f8eba9f12d68f1a1ed16e7399cef9052","before":"2439c25088cdd204bcd4a26419395bbb4755b920","commits":[{"sha":"be3c1e59f8eba9f12d68f1a1ed16e7399cef9052","author":{"email":"94274d0b635748ad8df96c0fc4f19e1ecd3f67e2@microsoft.com","name":"stephentoub"},"message":"Fix SocketException error codes and messages on Unix\n\nSocketException's public ctor takes an int, which it treats as as both a SocketError and the native error code, passing it down to the base Win32Exception to get the platform-specific message for the error.  However, SocketError is only the same as the native error code on Windows; on Unix, a translation is required, but that translation is missing.  As a result, every SocketException thrown from System.Net.Sockets on Unix comes out with an unhelpful message \"Unknown error: 0x12345\", where 0x12345 is the value for the SocketError, and the base native error code is set inappropriatley as the SocketError's value rather than as the real errno value.\n\nThis change puts a reverse mapping in place, such that the SocketError provided to SocketException is then translated back (as best as possible) into the underlying platform's native error code, which is then both stored on the base exception and used to get the appropriate platform-specific error message. So, for example, rather than getting an error like:\n```\nSystem.Net.Sockets.SocketException: Unknown error 10047\n```\nyou now get an error like:\n```\nSystem.Net.Sockets.SocketException: Address family not supported by protocol\n```\n\nAdditionally, several SocketErrors map to errno values that weren't included in our Interop.Errors enum.  I've added them.\n\nAnd, SocketException had dead code in the form of an \"internal SocketException(EndPoint endPoint)\" ctor that was never used.  As a result, the private _endPoint field was always null, and the Message property would always just return base.Message.  I've removed the constructor, the field, and the Message property override.  SocketException also had an ErrorCode property in the implementation that wasn't in the ref contract; I've removed it from the implementation, too.","distinct":true,"url":"https://api.github.com/repos/stephentoub/corefx/commits/be3c1e59f8eba9f12d68f1a1ed16e7399cef9052"}]}