Subject: [Boost-bugs] [Boost C++ Libraries] #13193: multiple sockets (reuse_address) + multiple io_service = packages never received
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-09-05 14:29:28
#13193: multiple sockets (reuse_address) + multiple io_service = packages never
received
-----------------------------------------------+---------------------------
Reporter: rafal2@⦠| Owner:
| chris_kohlhoff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.63.0 | Severity: Problem
Keywords: reuse_address,io_service,multiple |
-----------------------------------------------+---------------------------
In example program, we open several UDP sockets (each on same address/port
- with reuse_address),
and they use several io_service.
The result is that async_receive_from never reads any data.
1) N sockets (same addr/port), using N various io_service - doe not work
2) N sockets (each own port), using N various io_service - works
3) N sockets (same addr/port), but using same 1 io_service - works
4) 1 socket - works
The full test case is in github:
https://github.com/rfree-d/cppfuns/tree/79093a5458867ddbf0d36f0170a78465194370a4/asio_udp_srv
if you run "make run" then program starts using "mport" option - each
socket gets own port (so no need for the reuse flag) - and program works
fine.
if you run "make run_bug" then it is started without the "mport" and all
sockets listen on port 9000 - and then the program does not work
if you run the binary with no options then it shows usage (or grep sources
for 'options').
You can test program by sending data to UDP 9000 localhost,
or just build test program in other directory up:
https://github.com/rfree-d/cppfuns/tree/79093a5458867ddbf0d36f0170a78465194370a4/asio_udp_cli
there "make", and run it with options like "127.0.0.1 9000"
it is interactive, to send many data use:
aaa 1000 100000
for big packet sent once use
aaa 1000 1
to send one packet with string "exit" use
exit 1 1
Tested on Linux Debian 8 and 9.
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13193> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-09-05 14:35:53 UTC