Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#5822 closed Bugs (invalid)

asyncconnect generates multiple sockets

Reported by: GC <gert_corthout@…> 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 Olaf van der Spek <olafvdspek@…>, 11 years ago

AFAIK it's for internal usage. I think it's to support cancellation.

comment:2 by chris_kohlhoff, 10 years ago

Resolution: invalid
Status: newclosed

These sockets are used by the async connect's select()-based implementation. It's an example of the "self pipe trick".

comment:3 by weiyuemin@…, 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.

Note: See TracTickets for help on using tickets.