Actions
Feature #20018
closedGet the error codes as Socket::EAI_XXX when getaddrinfo and getnameinfo fail
Feature #20018:
Get the error codes as Socket::EAI_XXX when getaddrinfo and getnameinfo fail
Status:
Closed
Assignee:
-
Target version:
-
Description
Feature for implementing Happy Eyeballs version 2 (RFC 8305) in Socket.tcp.
Probrem¶
I would like to implement Happy Eyeballs version 2 (RFC 8305) in Socket.tcp.
In HEv2, EAI_ADDRFAMILY and EAI_AGAIN should be ignored when getaddrinfoo returns them in hostname resolution. However, there is currently no way to ask SocketError for errors returned by getaddrinfo
Proposal¶
I opened a PR to get errors when getaddrinfo and getnameinfo returns them.
https://github.com/ruby/ruby/pull/9018
Todo this,
- I added
Socket::ResolutionErroras a subclass ofSocketError - I added an attribute of
Socket::ResolutionErrorto get error code via `#error_code - I replaced
SocketError(rb_eSocket) withSocket::ResolutionError (rb_eResolutionError) inrsock_raise_socket_errorbecause this function is only called whengetaddrinfoandgetnameinfo` fail - I renamed
rsock_raise_socket_errortorock_raise_resolution_errorfor the same reason
In addition, Socket::ResolutionError is a subclass of SocketError, so it does not affect rescue SocketError in source codes.
Updated by mame (Yusuke Endoh) almost 2 years ago
- Status changed from Open to Closed
https://github.com/ruby/ruby/pull/9018 was merged. Closing.
Actions