Skip to content

Dealing with stacks that need pinning #61

@chrysn

Description

@chrysn

Do we have a story for how to deal with stacks that need their sockets pinned?

For example, RIOT's sock_udp_t needs to stay in a place in memory from the time it is connected or bound -- aka be pinned.

The options I see are:

  1. Making all functions that now take &mut socket take a Pin<&mut socket> -- a breaking API change that'd require all general applications to pin their sockets (general applications that can't would require ``ST: UdpStack, ST::Socket: Unpin`).
  2. Using workarounds like currently in riot-wrappers where Stack upon creation has some pinned memory inside which the immovable sockets are created, and where the exposed sockets are just pointers to these.

Is 1. an option on the long run?

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