summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/tcpsocket.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/socket/tcpsocket.c b/ext/socket/tcpsocket.c
index a7a82fd880..012a8f5a64 100644
--- a/ext/socket/tcpsocket.c
+++ b/ext/socket/tcpsocket.c
@@ -41,7 +41,16 @@ tcp_sockaddr(struct sockaddr *addr, socklen_t len)
* call-seq:
* TCPSocket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list]
*
- * Lookups host information by _hostname_.
+ * Use Addrinfo.getaddrinfo instead.
+ * This method is deprecated since following reasons:
+ *
+ * - The 3rd element of result is the address family of the first address.
+ * The address families of rest addresses are not returned.
+ * - gethostbyname() is may take long time and it may block other threads.
+ * (GVL cannot be released since gethostbyname() is not thread safe.)
+ * - This method uses gethostbyname() function already removed from POSIX.
+ *
+ * This method lookups host information by _hostname_.
*
* TCPSocket.gethostbyname("localhost")
* #=> ["localhost", ["hal"], 2, "127.0.0.1"]