Reputation: 419
I have just realized looking through TCPView that one single TCP connection established using boost::asio creates two connections. One of them using local ports and a second one with the desired remote port. Why? Is this behaviour normal? Is there a way of creating just one?
This question was originally posted several years ago:
but nobody replayed.
Edit:
I'm connecting to the port 8001 and this is what I see with netstat -nao:
TCP 127.0.0.1:10246 127.0.0.1:8001 ESTABLISHED 3252
TCP 127.0.0.1:10244 127.0.0.1:10245 ESTABLISHED 3252
TCP 127.0.0.1:10245 127.0.0.1:10244 ESTABLISHED 3252
Thank you!
Upvotes: 1
Views: 404
Reputation: 310980
This is two connections, not three. Check the port numbers. Evidently the library creates a connection to itself for some reason.
It would be interesting to know whether it happens again when you create a second connection.
Upvotes: 0