Repository navigation
Commit 3952d11
committed
Fix tcp_server::bind() to not throw despite returning error_code
tcp_server::bind() was documented to return std::error_code but
internally called the throwing tcp_acceptor::listen() overload,
violating its API contract.
Add non-throwing listen() overloads to tcp_acceptor that take
std::error_code& as the last parameter, following Boost.Asio
conventions. The throwing overload now delegates to the non-throwing
implementation.
Changes:
- Add tcp_acceptor::listen(endpoint, std::error_code&)
- Add tcp_acceptor::listen(endpoint, int backlog, std::error_code&)
- Update tcp_server::bind() to use the non-throwing overload
- Add tests for success and failure paths using TEST-NET-1 addresses
- Add test for listen() on already-open acceptor behavior1 parent e56eb71 commit 3952d11
13 files changed
Lines changed: 591 additions & 507 deletions
File tree
- doc/modules/ROOT/pages/guide
- include/boost/corosio
- src/corosio/src
- test
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
0 commit comments