Skip to content

Asynchronous packet pool notifications #387

@elrafoon

Description

@elrafoon

In asynchronous networking code, it would be very helpful to have a notification when packet was returned to the packet pool, and in turn it becomes possible to allocate packet from that pool, without blocking.

There are similar notifications on sockets.

I'm willing to develop the code and submit PR, but I'd like to agree on the design.

In my opinion there are at least these 2 paths:

  1. add callback function and parameter to NX_PACKET_POOL structure
  2. add linked list with callback functions and parameters to NX_PACKET_POOL structure

I vote for option 2, because there can be many clients interested in allocating packets from the same pool.

PS: I know I can spawn multiple threads and block on packet allocation, but I'm writing async code and this approach is not usable for me.

Metadata

Metadata

Assignees

Labels

featureNew feature or enhancement request

Type

No type
No fields configured for issues without a type.

Projects

Status
Evaluation

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions