Add SO_RCVLOWAT accessors for Linux and Android

未关闭
#692 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
api, networking

调研方向

The payload names no files, so start from the existing receive-buffer-size accessors and the platform-specific cfg blocks they sit beside; those show the pattern for usize arguments, range checks, and SO_* constants on Linux/Android. Add Socket::recv_lowat and Socket::set_recv_lowat under the all feature, forwarding SO_RCVLOWAT and rejecting values above the kernel's signed range. The proposed TCP test is the done check: a connected socket becomes readable only once queued bytes reach the threshold.

由索引模型根据 Issue 内容生成。

描述

Would socket2 accept Socket::recv_lowat and Socket::set_recv_lowat for the SO_RCVLOWAT socket option?

A TCP receiver can use this option to wait for a batch of received bytes before becoming readable. It is useful when paced traffic otherwise wakes the reader for each small arrival. Raising the threshold can also delay a short read, so the caller still owns when to set it and when to restore it. Linux socket(7)

I propose starting with Linux and Android under the all feature, alongside the existing platform-specific accessors. The methods would use usize in bytes, like the receive buffer size methods, and reject values above the range of the signed integer accepted by the kernel. They would otherwise forward the option to the OS.

The test would use a connected TCP socket and check that it becomes readable when the queued bytes reach the configured threshold.

主要语言
Rust
星标
885
派生
328
平均合并
6 天 12 小时
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rust-lang/socket2 的其他 Issue

查看 rust-lang/socket2 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。