
Originally Posted by
Dumbledore
If you have a QTcpServer and you pass off a new connection to its own thread. Does this also communicate on some random port? Or is it the same port as the listener that this connection is established?
It's a different port.
If it is a different port, how do you deal with firewalls?
You don't. Firewalls should track connections and pass such traffic that was established on another port. At least that's what the TCP protocol says 
If you use iptables, a rule similar to:
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
To copy to clipboard, switch view to plain text mode
should be present in the firewall for tcp traffic to work properly. If you're not a firewall admin, you needn't care.
Bookmarks