Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to flush a transmit buffer? #190

Open
amaitra opened this issue Sep 19, 2023 · 0 comments
Open

How to flush a transmit buffer? #190

amaitra opened this issue Sep 19, 2023 · 0 comments

Comments

@amaitra
Copy link

amaitra commented Sep 19, 2023

I have a simple pub-sub application. The pub publishes events, expects the subs to work on them and respond back. The pub waits for subs to complete their actions (variable time) or times out (outside scope of zmq).

I frequently find the sub receives a message, puts out a response (on a separate message channel) but the pub process does not receive it until much later. Sometimes in fact after a timeout in the pub which moves on (state machine). But it is always received - mostly on a close from the subscriber end.

I do not want to block on every message - but in certain cases, I want it. I want the equivalent of fflush(fd) - pushes it out so that it is in the receivers queue. The CPU may be busy in some of these intervals (that is when this tends to happen). The time out is in the order of 5 seconds - long time in a server class CPU.

Both pub-sub entities are running on a single system (no network).

There does not seem to be a way to set up the socket that way? Or flush it on demand. Or am I missing something?

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

No branches or pull requests

1 participant