Skip to content

The library is not thread safe when using Tcp provider #8

@barakakha

Description

@barakakha

In the Tcp provider class, in method SendAsync you use Stream.WriteAsync of NetworkStream without any synchronisation. Only if you use the buffer option it is thread-safe

according to the NetworkStream doc

Read and write operations can be performed simultaneously on an instance of the NetworkStream class without the need for synchronization. As long as there is one unique thread for the write operations and one unique thread for the read operations, there will be no cross-interference between read and write threads and no synchronization is required.

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