Samuel Williams
844a9dff88
Try `nil` as default for 'default timeout'. ( #6509 )
2022-10-08 14:02:34 +13:00
Samuel Williams
e4f91bbdba
Add IO#timeout attribute and use it for blocking IO operations. ( #5653 )
2022-10-07 21:48:38 +13:00
David Carlier
d35bc88b37
sockopt adding Linux constants, SO_INCOMING_CPU/SO_INCOMING_NAPI_ID.
2022-09-21 17:15:54 +09:00
David Carlier
8cbbc061c4
openbsd sockets add SO_RTABLE constant
2022-09-21 17:10:36 +09:00
David Carlier
ec2d13567e
Introduces FreeBSD's SO_USER_COOKIE among socketopt's options.
2022-09-21 15:48:34 +09:00
David CARLIER
8a9dfb676b
sockets add `TCP_CONNECTION_INFO` and `TCP_KEEPALIVE` constants.
2022-09-21 15:23:50 +09:00
David CARLIER
017573c3b3
socket add FreeBSD's SO_SETFIB constant.
2022-09-21 15:22:47 +09:00
Sutou Kouhei
e40fa6c480
[DOC] socket: fix wrong sample addresses ( #6372 )
...
IPv6 link local address is fe80::/10 not ff80::/10:
https://www.rfc-editor.org/rfc/rfc4291.html
Link-Local unicast 1111111010 FE80::/10 2.5.6
IPv6 (deprecated) site local address is fec0::/10 not ffc0::/10:
https://www.rfc-editor.org/rfc/rfc3513.html
Site-local unicast 1111111011 FEC0::/10 2.5.6
2022-09-20 16:09:42 +09:00
Takashi Kokubun
5b21e94beb
Expand tabs [ci skip]
...
[Misc #18891 ]
2022-07-21 09:42:04 -07:00
Kazuhiro NISHIYAMA
d06f787e9f
Fix broken links of rdoc
...
- `www.ruby-lang.org` links to `./www.ruby-lang.org`
- `cgi['field_name']` links to `./'field_name'`
2022-03-17 10:11:38 +09:00
Peter Zhu
2d5ecd60a5
[Feature #18249 ] Update dependencies
2022-02-22 09:55:21 -05:00
Peter Zhu
ffda21b7ba
[Feature #18491 ] Drop support for HP-UX
...
IA64 support was dropped in ticket #15894 , so we can drop support for
HP-UX.
2022-01-18 09:52:15 -05:00
Nobuyoshi Nakada
ac152b3cac
Update dependencies
2021-11-21 16:21:18 +09:00
Yusuke Endoh
8413749ec0
ext/socket/extconf.rb: Fix the chech if if_indextoname is available
...
The check had not work because "headers" were not passed.
2021-11-02 23:41:01 +09:00
Nobuyoshi Nakada
e057b9eea9
Prefer the reentrant versions of gmtime and localtime
2021-10-14 23:44:15 +09:00
Kazuhiro NISHIYAMA
8dd6d58543
Add more socket constants
...
from http://manpages.ubuntu.com/manpages/focal/en/man2/socket.2.html
2021-10-12 16:45:22 +09:00
卜部昌平
5c167a9778
ruby tool/update-deps --fix
2021-10-05 14:18:23 +09:00
Kazuhiro NISHIYAMA
e0c6e8c64a
[DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]
2021-09-23 09:20:00 +09:00
Mike Dalessio
c0f4e4ca6d
undefine alloc functions for C extensions
...
per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:
- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
2021-08-20 08:30:06 +09:00
Samuel Williams
028441d22f
Avoid calling `fstat` on things we already know are valid sockets.
2021-07-12 19:16:22 +12:00
Nobuyoshi Nakada
fd7023a87e
Convert ssize_t properly
2021-06-23 10:09:25 +09:00
Samuel Williams
45e65f302b
Deprecate and rework old (fd) centric functions.
2021-06-22 22:48:57 +12:00
Samuel Williams
3deb5d7113
Direct io for accept, send, sendmsg, recvfrom, and related methods.
2021-06-22 22:17:53 +12:00
Nobuyoshi Nakada
626427c2e0
Removed no longer used variables
2021-06-14 14:11:38 +09:00
Samuel Williams
2792acc8f2
Add scheduler hook `Addrinfo.getaddrinfo`. ( #4375 )
...
Co-authored-by: Bruno Sutic <code@brunosutic.com>
2021-06-14 16:21:08 +12:00
卜部昌平
6413dc27dc
dependency updates
2021-04-13 14:30:21 +09:00
Dimitris Zorbas
46b5b51cc6
[DOC] Fix typo in ext/socket/socket.c [ci skip]
2021-02-04 13:29:58 +09:00
Marcus Stollsteimer
3108ad7bf3
[DOC] Fix grammar: "is same as" -> "is the same as"
2021-01-05 15:13:53 +01:00
Masaki Matsushita
1ffb267c5c
Fix compile error of sockssocket
...
The patch is provided by PhobosK (Phobos Kappa).
This should be backported to Ruby 3.0.
[Feature #17187 ]
2020-12-29 15:52:42 +09:00
Nobuyoshi Nakada
8918a9cf6c
Removed rb_cData entity
...
* Use the wrapper of rb_cObject instead of data access
* Replaced rest of extentions
* Updated the version guard for Data
* Added the version guard of rb_cData
2020-12-22 02:51:49 +09:00
Koichi Sasada
a07f249803
socket is ractor-safe.
2020-12-18 11:23:34 +09:00
Masaki Matsushita
56918578ea
Remove unimplemented parameter from comment
...
:resolv_timeout of TCPSocket.new is not implemented for now.
2020-12-11 11:13:24 +09:00
Masaki Matsushita
78f188524f
Add connect_timeout to TCPSocket
...
Add connect_timeout to TCPSocket.new in the same way as Socket.tcp.
Closes [Feature #17187 ]
2020-12-10 20:52:29 +09:00
Masaki Matsushita
5d8bcc4870
Revert getaddrinfo_a()
...
getaddrinfo_a() gets stuck after fork().
To avoid this, we need 1 second sleep to wait for internal
worker threads of getaddrinfo_a() to be finished, but that is unacceptable.
[Bug #17220 ] [Feature #17134 ] [Feature #17187 ]
2020-12-07 13:33:53 +09:00
Masaki Matsushita
76439eee68
Call cleanup function for getaddrinfo_a(3) only before fork()
...
Previously, rb_getaddrinfo_a_before_exec() is called from before_exec().
However, the function needs to be called only before fork().
The change moves it to before_fork().
2020-12-06 01:32:43 +09:00
Masaki Matsushita
c56a1c1953
Extend sleep time to 1.5 second in rb_getaddrinfo_a_before_exec()
...
After 94d49ed31c
, TestSocket#test_getaddrinfo_after_fork fails in some
platforms. To avoid this, the change extends sleep time to 1.5 second.
2020-12-06 01:01:13 +09:00
Masaki Matsushita
94d49ed31c
Add a hook before fork() for getaddrinfo_a()
...
We need stop worker threads in getaddrinfo_a() before fork().
This change adds a hook before fork() that cancel all outstanding requests
and wait for all ongoing requests. Then, it waits for all worker
threads to be finished.
Fixes [Bug #17220 ]
2020-12-04 23:31:51 +09:00
Rei Odaira
305c79af2f
ext/socket/rubysocket.h: avoid the conflict of T_DATA definition in AIX
2020-11-01 00:12:55 -05:00
Aaron Patterson
9f3adaf529
Use public allocators for creating new T_OBJECT objects
...
This way the header flags and object internals are set correctly
2020-10-28 18:35:22 -07:00
Yusuke Endoh
950614b088
ext/socket/ipsocket.c: prevent "warning: unused variable 'resolv_timeout'"
2020-09-27 02:38:39 +09:00
Masaki Matsushita
f2d1808e73
Add comments for resolv_timeout
2020-09-25 15:39:26 +09:00
Masaki Matsushita
511fe23fa2
Add resolve_timeout to TCPSocket [Feature #17134 ]
2020-09-25 15:19:14 +09:00
Masaki Matsushita
6d946665bd
Show deprecation warning on Socket.gethostbyname and Socket.gethostbyaddr
2020-08-29 17:18:59 +09:00
Masaki Matsushita
9658a5a849
Show deprecation warning on TCPSocket.gethostbyname
2020-08-28 01:01:51 +09:00
Nobuyoshi Nakada
96d701f737
Adjust indents [ci skip]
2020-08-27 23:39:15 +09:00
卜部昌平
490010084e
sed -i '/rmodule.h/d'
2020-08-27 16:42:06 +09:00
Kir Shatrov
2038cc6cab
Make Socket.getaddrinfo interruptible ( #2827 )
...
Before, Socket.getaddrinfo was using a blocking getaddrinfo(3) call.
That didn't allow to wrap it into Timeout.timeout or interrupt the thread in any way.
Combined with the default 10 sec resolv timeout on many Unix systems, this can
have a very noticeable effect on production Ruby apps being not
resilient to DNS outages and timing out name resolution, and being unable to fail fast even
with Timeout.timeout.
Since we already have support for getaddrinfo_a(3), the async version
of getaddrinfo, we should be able to make Socket.getaddrinfo leverage that
when getaddrinfo_a version is available in the system (hence #ifdef
HAVE_GETADDRINFO_A).
Related tickets:
https://bugs.ruby-lang.org/issues/16476
https://bugs.ruby-lang.org/issues/16381
https://bugs.ruby-lang.org/issues/14997
2020-08-27 16:39:13 +09:00
卜部昌平
756403d775
sed -i '/r_cast.h/d'
2020-08-27 15:03:36 +09:00
卜部昌平
0da2a3f1fc
sed -i '\,2/extern.h,d'
2020-08-27 14:07:49 +09:00
Samuel Williams
0e3b0fcdba
Thread scheduler for light weight concurrency.
2020-05-14 22:10:55 +12:00