Add support for TCP_CONNECTIONTIMEOUT on MacOS

Open
#612 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
macos, rust
Domain
networking

Research direction

Start by comparing the existing set_tcp_user_timeout and tcp_user_timeout methods with the macOS tcp.h definition at line 221 for TCP_CONNECTIONTIMEOUT. Check whether the option matches the Linux behavior, then determine the appropriate macOS-gated API and validate it with the project's relevant socket tests. Done means the option is exposed only on macOS with behavior documented by tests.

Written by the indexing model from the issue text.

Description

The set_tcp_user_timeout and tcp_user_timeout, which relate to the TCP_USER_TIMEOUT linux option, are enabled only under linux-related flags (Android or Fuchsia or Linux or target_os="cygwin").

However, it seems like MacOS has a similar option, just named differently, in tcp.h, line 221:

#define TCP_CONNECTIONTIMEOUT   0x20    /* connection timeout */

Should we maybe expose relevant methods for this option (behind macOS feature)? I assume it does the same with TCP_USER_TIMEOUT, but even if it doesn't it would be nice to have because it certainly does something related to connection timeout.

Dominant language
Rust
Stars
885
Forks
328
Avg merge
6d 12h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/socket2

All issues in rust-lang/socket2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.