#5822 closed Bugs (invalid)
asyncconnect generates multiple sockets
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.46.0 | Severity: | Cosmetic |
Keywords: | asyncconnect multiple sockets | Cc: |
Description
I already posted this on the mailing list, but since no-one replied and said this is a feature I assume it is a bug.
Start the chatserver example. Run TcpView (from sysinternals). Look at the sockets generated by the example. As expected the server has created 1 socket and its status is "listening". Ok so far. Next start the chat client example. It generates 3 sockets! One is expected: it targets the port the server is listening on. But there are 2 others in "established" state. They target each other. Why are they there and what are they doing? NOTE: ofc the server generated a new "established" socket as well.
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 10 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
These sockets are used by the async connect's select()-based implementation. It's an example of the "self pipe trick".
comment:3 by , 9 years ago
Take the liberty to ask: isn't asio using iocp-based implementation on Windows ?
We are enduring problems because of the two unexpected sockets which target each other. Some firewalls / anti-virus softwares also suspected this.
AFAIK it's for internal usage. I think it's to support cancellation.