Skip to content

Peeking a UDPSocket? #596

Closed
Closed
@matthewrobertbell

Description

@matthewrobertbell

I can use peek on a TCPStream to see how many bytes are available to read. I use this to avoid blocking when calling read.

With UDPSocket, there doesn't seem to be a way to avoid blocking when using recv_from to read data into a buffer. I want something that either reads a UDP packet or immediately returns. Does this exist?

EDIT: recv and recv_from seem to be exactly the same. recv uses recv_from in its example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions