Reputation: 171
In Qt5 if we use qtcpSocket->->disconnectFromHost(); that mean i close competely the connection to the distant Host. My question is how can i reject a tcp connection ???
Thx all
Upvotes: 2
Views: 757
Reputation: 2669
It's a TCP protocol design question. Once a connection is opened, you can't reject it. You just can closed, if
Detailed explanation in this answer: https://stackoverflow.com/a/1117132/721929
Upvotes: 1
Reputation: 3393
You can't. After the passive open(), the OS accepts every connection while your program sleeps.
Upvotes: 4