Add SO_RCVLOWAT accessors for Linux and Android

Aberta
#692 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
72/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
api, networking

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
885
Forks
328
Merge médio
6d 12h
PRs com merge (30d)
2

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de rust-lang/socket2

Todas as issues de rust-lang/socket2

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.