Skip to content

A socket close operation doesn't always send an event #3367

@bogdanm

Description

@bogdanm

The event function in TCPSocket increments the internal _pending variable and doesn't send an event if the value of _pending s not 1: https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPSocket.cpp#L166

However, it seems that only send and recv set the value of that variable to 0. This means that events will be fired for send and receive operations, but not for close operations (https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/Socket.cpp#L66) unless _pending happens to be 0.

Is this a bug or I'm not using socket events properly?

@marcuschangarm

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