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

Add a simple SNDPRIO implemention on req0 #1743

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hoytluo
Copy link

@hoytluo hoytluo commented Dec 26, 2023

fixes #104 Need RCVPRIO and SNDPRIO options

I have added a very simple implemention on req0 to solve my connected two rep server. would you like to merge this into your master?
I add the NNG_OPT_SNDPRIO on the dialer, then copy the sndpri to the nni_pipe on req0_pipe_start function. then resort the ready_pipes.

Maybe you can provide better implementation methods. thanks!

if (nni_pipe_peer(p->pipe) != NNG_REQ0_PEER) {
return (NNG_EPROTO);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option should be a generic option, not just on dialers, but on end points, and then configured on the pipe by the end point.

I also think that we should expand this to RECV priority as well, so that we can use the same option for REP to give preference to some peers. I would like to think on this a bit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, in the nanomsg code, I find the ep option when I call the nn_connect function, and then copy the socket option(ep_template) to pipe .
But in the nng code, I can't find the ep . Are the dialer and listener eps? If so, I will add option on the listener also or only add option on the socket, and then copy this option to dialer or listener on creating them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added SNDPRIO to listener also.

@hoytluo
Copy link
Author

hoytluo commented Jan 3, 2024

Ok, I will study howto correct this on end points.

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

Successfully merging this pull request may close these issues.

Need RCVPRIO and SNDPRIO options
2 participants