Skip to content

Thread safety using WSAOVERLAPPED #2838

@maxsharabayko

Description

@maxsharabayko

PR #2834 has a problem, The srt::CChannel::sendto will be call in CSndQueue(thread1) and CRcvQueue(thread2), and that not thread safety.

Them used same WSAOVERLAPPED, so WSASendTo maybe not completed when WSAWaitForMultipleEvents return.

From https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasendto

The lpOverlapped parameter must be valid for the duration of the overlapped operation. If multiple I/O operations are simultaneously outstanding, each must reference a separate WSAOVERLAPPED structure.

Originally posted by @mGaosi in #2834 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugIndicates an unexpected problem or unintended behavior[core]Area: Changes in SRT library core

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions