Support `sockatmark()`-like functionality

Offen
#450 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
rust
Bereich
networking

Rechercherichtung

Beginne mit socket2s vorhandener Option set_out_of_band_inline() und überprüfe, wie plattformspezifische Socket-Operationen bereitgestellt werden. Vergleiche POSIX sockatmark(), den SIOCATMARK ioctl und die referenzierte WinSock-Unterstützung; abgeschlossen ist die Arbeit, wenn eine synchrone API auf unterstützten Systemen melden kann, ob der Socket die Urgent-Markierung erreicht hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
885
Forks
328
Ø Merge
6 T. 12 Std.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rust-lang/socket2

Alle Issues in rust-lang/socket2

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.