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

Couldn't set static incoming listen port properly #1279

Open
Nirzak opened this issue May 20, 2024 · 6 comments
Open

Couldn't set static incoming listen port properly #1279

Nirzak opened this issue May 20, 2024 · 6 comments

Comments

@Nirzak
Copy link

Nirzak commented May 20, 2024

Hi, I was trying to set a static incoming listen port without a range of ports.

we know that we can set that using the following option

network.port_range.set=port_range

but this config only accepts a range of ports. not a static port. So, I was trying the below config from the website

network.port_open.set
network.port_open

but it seems like they do nothing. we only have a choice now to use the range port config like as the following to use static port

network.port_range.set=static_port-static_port

Am I missing something? or does it still need to be implemented? Thanks a lot.

@kannibalox
Copy link
Contributor

network.port_open is a boolean setting, used for turning on or off the port entirely. network.port_range.set=static_port-static_port is the correct way to set a static port. See https://kannibalox.github.io/rtorrent-docs/cmd-ref.html#network-commands for more details.

@Nirzak
Copy link
Author

Nirzak commented May 20, 2024

network.port_open is a boolean setting, used for turning on or off the port entirely. network.port_range.set=static_port-static_port is the correct way to set a static port. See https://kannibalox.github.io/rtorrent-docs/cmd-ref.html#network-commands for more details.

I know and I had exactly used that. used like as the following

network.port_open = yes
network.port_open.set = 41200

but nothing happens.

And I know the range trick works but still on the UI it’s showing 41200-41200

I mean why a single static port will be shown like this. with a hyphen in the middle. Isn’t it we can use another config to set the static port in a more correct manner rather than setting it as a range set which is not for static at all? and what is the network.port_open.set config is doing actually then?

@kannibalox
Copy link
Contributor

network.port_open = yes
network.port_open.set = 41200

network.port_open is used to query whether or not the value is true, as such it ignores the "yes" and changes nothing. network.port_open.set = 41200 enables the port, since rTorrent considers any non-zero value to be the same as "yes". "yes" is the default, so it still doesn't actually change anything.

I mean why a single static port will be shown like this. with a hyphen in the middle. Isn’t it we can use another config to set the static port in a more correct manner rather than setting it as a range set which is not for static at all? and what is the network.port_open.set config is doing actually then?

It's just a quirk of rtorrent, any kind of new configuration option to set a single port would just be a convenience function that does the exact same thing as network.port_range.set=41200-41200. I'm not sure what you mean when you say it's not static at all. rTorrent will trying to listen on port 41200, and if it's already being listened on, rTorrent will exit with an error message.

@Nirzak
Copy link
Author

Nirzak commented May 20, 2024

network.port_open = yes
network.port_open.set = 41200

network.port_open is used to query whether or not the value is true, as such it ignores the "yes" and changes nothing. network.port_open.set = 41200 enables the port, since rTorrent considers any non-zero value to be the same as "yes". "yes" is the default, so it still doesn't actually change anything.

I mean why a single static port will be shown like this. with a hyphen in the middle. Isn’t it we can use another config to set the static port in a more correct manner rather than setting it as a range set which is not for static at all? and what is the network.port_open.set config is doing actually then?

It's just a quirk of rtorrent, any kind of new configuration option to set a single port would just be a convenience function that does the exact same thing as network.port_range.set=41200-41200. I'm not sure what you mean when you say it's not static at all. rTorrent will trying to listen on port 41200, and if it's already being listened on, rTorrent will exit with an error message.

Ok I see. Thanks a lot. But I still couldn't grab the purpose of the network.port_open.set configuration option. that what does it do if network.port_range.set is basically setting the incoming port always.

@kannibalox
Copy link
Contributor

If for some reason you wanted to completely disable the listening port, you can't do that via network.port_range.set. You'd need to do network.port_open.set = no.

@Nirzak
Copy link
Author

Nirzak commented May 20, 2024

If for some reason you wanted to completely disable the listening port, you can't do that via network.port_range.set. You'd need to do network.port_open.set = no.

Oh OK I see. that means network.port_open and network.port_open.set are the same. the latter is just an alias of the previous one. So it's a boolean value whether we want to turn off the listening port or not. I see. thanks a lot, bro for the explanation.

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

2 participants