Skip to content

TcpSocketClient callback queues are being lost between instances #86

@beau6183

Description

@beau6183

I can submit a sample project to prove the issue, but it appears that callbacks are being referenced from different instances of TcpSocketClient and failing.

TcpSockets creates an instance of TcpSocketClient at init. Then, on first client connection, a new TcpSocketClient instance is created by TcpSockets, but the callbacks from write are saved in the first instances's _pendingSends. When the message is written to the socket and the callback is requested to call, the second instance checks it's own _pendingSends for the callback and cannot locate it. This causes a lock on writes after the first message is sent.

I have a fix which moves the _pendingWrites queue (and _sendTag) to the delegate and handled centrally through delegate handlers. Will submit a PR.

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