Support `sockatmark()`-like functionality

Aperta
#450 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

Inizia con l’opzione esistente set_out_of_band_inline() di socket2 e esamina come vengono esposte le operazioni socket specifiche della piattaforma. Confronta POSIX sockatmark(), l’ioctl SIOCATMARK e il supporto WinSock indicato; il lavoro è completato quando un’API sincrona può segnalare se il socket ha raggiunto il contrassegno urgente sui sistemi supportati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

socket2 cannot currently handle the TCP urgent flag correctly according to specifications. Per https://www.rfc-editor.org/rfc/rfc1122#page-84 and https://www.rfc-editor.org/rfc/rfc6093#page-5, the intended standard method of handling the urgent flag in TCP is to notify the process out-of-band that there is an urgent mark, at which point the process moves into an "urgent mode" until reaching the urgent mark in-band. socket2 is currently missing the ability for the process to detect when it has reached the urgent mark.

While https://github.com/rust-lang/socket2/issues/296 suggests that polling is out-of-scope for socket2, this shouldn't be necessary for implementing this functionality. Using the POSIX socket API, a process can set SO_OOBINLINE as a socket option (to which set_out_of_band_inline() is equivalent) and use sockatmark() to detect when the urgent mark is reached, independent of polling mechanism.

The SIOCATMARK ioctl is the basis of sockatmark() and could be consumed by socket2 to provide this functionality. https://github.com/rust-lang/libc/pull/3275 intends to expose this for Unix-like systems and it is exposed in the WinSock Rust crate. A synchronous function is_at_urgent_mark(&self) -> bool or similar would address this gap.

Lingua principale
Rust
Stelle
885
Fork
328
Merge medio
6g 12h
PR unite (30g)
2

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/socket2

Tutte le issue di rust-lang/socket2

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.