Skip to content

Feature Request: datagram_readable &datagram_writeable & try_send/recv_datagram #2351

@Aderinom

Description

@Aderinom

Hello Team!

At the moment quinn, on datagrams, offers:

  • send_datagram - which overwrites datagrams in the send buffer
  • send_datagram_wait - which waits until the datagram can be enqueued
  • read_datagram - which waits until a datagram has been received

These functions all require:

  1. The buffer which should possibly be sent/received on at that moment to already exist -> Possibly wasted work
  2. The caller to wait for them/ or accepting data to be lost -> Caller has no control

With this, the User lacks some low level control over the Connection.

I would like to propose adding:

  • poll_send_datagram - checking if send is blocked, and if so registering the poller with the datagrams_unblocked notifier.
  • poll_read_datagram - checking if receive is blocked, and if so registering the poller with the datagrams_received notifier.

For higher level integration and for the caller to attempt operation without side effect on fail:

  • try_send_datagram \ try_receive_datagram - returning a WouldBlock if operation can not be handled without waiting

This would allow a user to check the state of the socket, and decide what to do based on this.
Especially latency sensitive applications or ones which have do internal congestion control could profit from this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions