From 6382f5cc91ac9e36776bc854632d9a1237250da7 Mon Sep 17 00:00:00 2001 From: Masaki Matsushita Date: Mon, 31 Dec 2018 12:17:39 +0900 Subject: Support timeout for Addrinfo Addrinfo.getaddrinfo and .foreach now accepts :timeout in seconds as a keyword argument. If getaddrinfo_a(3) is available, the timeout will be applied for name resolution. Otherwise, it will be ignored. Socket.tcp accepts :resolv_timeout to use this feature. --- time.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'time.c') diff --git a/time.c b/time.c index 1e760f6ca5..18bed6d68a 100644 --- a/time.c +++ b/time.c @@ -2698,6 +2698,12 @@ rb_time_timespec(VALUE time) return time_timespec(time, FALSE); } +struct timespec +rb_time_timespec_interval(VALUE num) +{ + return time_timespec(num, TRUE); +} + enum { TMOPT_IN, TMOPT_MAX_ -- cgit v1.2.3