Skip to content

Add timeout option #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add timeout option #104

wants to merge 6 commits into from

Conversation

Watson1978
Copy link
Contributor

Fix #103

@Watson1978
Copy link
Contributor Author

Hmm, looks like the socket settings created with Socket.tcp different...

@@ -21,6 +21,8 @@ Gem::Specification.new do |gem|
gem.require_paths = ['lib']
gem.license = "Apache-2.0"

gem.required_ruby_version = '>= 3.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems TCPSocket.new supports connect_timeout and resolv_timeout since Ruby 3.0
https://github.com/ruby/ruby/blob/v3_0_0/ext/socket/tcpsocket.c#L23-L51

Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 marked this pull request as ready for review July 18, 2025 08:08
@daipom daipom self-requested a review July 18, 2025 08:11
@Watson1978
Copy link
Contributor Author

@daipom @kenhys Can you please review this PR ?

Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this improvement!

Looks good to me about adding connect_timeout option.

About resolv_timeout, I have some concerns, and commented below.
Could you please check it?

Signed-off-by: Shizuo Fujita <[email protected]>
Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 changed the title Add connect_timeout / resolve_timeout option Add timeout option Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting socket timeouts
2 participants