Skip to content

Port forwarding #24

Closed Answered by shikokuchuo
wlandau asked this question in Q&A
Feb 27, 2023 · 1 comments · 10 replies
Discussion options

You must be logged in to vote

NNG always uses an ephemeral port for outbound dialers, this is assigned automatically by the IP stack, so one less thing you need to worry about.

Crossed wires is not possible - as we are using TCP, which is a bytestream - it is for ordered transmission and not lossy like UDP. Further NNG adds much stricter guarantees through its own scalability protocols on top of the transport layer.

On the client, instead of using parallelly::freePort(), you can also just specify port 0 on the client e.g. daemons("tcp://xx.xxx.xxx.175:0"). To retrieve the actual port used, you can on the socket:

nanonext::parse_url(nanonext::opt(sock[["listener"]][[1]], "url"))[["port"]]

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@shikokuchuo
Comment options

@shikokuchuo
Comment options

@wlandau
Comment options

@wlandau
Comment options

@shikokuchuo
Comment options

Answer selected by shikokuchuo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants