Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature. NetMQSocket TryReceive with CancellationToken #1078

Open
IliaPodolko opened this issue Oct 16, 2023 · 0 comments
Open

Feature. NetMQSocket TryReceive with CancellationToken #1078

IliaPodolko opened this issue Oct 16, 2023 · 0 comments

Comments

@IliaPodolko
Copy link

Hi, I have a DealerSocket (it is a child of NetMQSocket).
And I want to use TryReceiveMultipartMessage method with cancellationToken.
This extension method uses "TryReceive" method.
if (!socket.TryReceive(ref msg, timeout))

TryReceive uses private field m_socketHandle to call "TryRecv" without cancellationToken.
m_socketHandle.TryRecv(ref msg, timeout);

CancellationToken logic was implemented in #876

So ideally we can just overload the NetMQSocket::TryReceive and pass cancellationToken.
And create additional extension method TryReceiveMultipartMessage to use cancellationToken as well.
Is it a bad idea or somebody knows another way how to terminate TryReceiveMultipartMessage?
Because even if I dispose the socket - it does not interrupt the method immediately.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant