Port forwarding #24
-
Related to #22 (reply in thread): is there a port forwarding mechanism for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
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 nanonext::parse_url(nanonext::opt(sock[["listener"]][[1]], "url"))[["port"]] |
Beta Was this translation helpful? Give feedback.
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: