Skip to content

The meaning of capy::cond::canceled #283

@akrzemi1

Description

@akrzemi1

The description of the capy::cond::canceled in https://github.com/cppalliance/capy/blob/develop/include/boost/capy/cond.hpp#L50 says:

An error_code compares equal to canceled when:
(1) the operation's stop token was activated,
(2) the I/O object's cancel() was called,
(3) or a platform cancellation error occurred.

Conflating the third reason (platform-specific cancellation) with the first two makes capy::cond::canceled less usable. The first two correspond to stop signal from Senders/Receivers and could be mapped on the stop slot. But the third one just doesn't fit: it may mean, "the socket was closed on the other end by the other system" (CONNRESET). It just looks like an "error", much like "couldn't connect".

What is the motivation of representing all three under the same condition?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions