Allow accessing the local endpoint when using the Asio transport. fixes #458
This commit is contained in:
1 parent
4e2fb75d07
commit
5500aef4ce
2 files changed
+27
-2
No files matched your search
+5
-2
@@ -4,6 +4,10 @@ HEAD
|
||||
Custom Asio transport socket policies will need to be updated accordingly.
|
||||
This does not affect anyone using the bundled socket policies.
|
||||
- Feature: Basic support for the permessage-deflate extension. #344
|
||||
- Feature: Allow accessing the local endpoint when using the Asio transport.
|
||||
This allows inspection of the address and port in cases where they are chosen
|
||||
by the operating system rather than the user. Thank you Andreas Weis and
|
||||
Muzahid Hussain for reporting and related code. #458
|
||||
- Improvement: Better automatic std::chrono feature detection for Visual Studio
|
||||
- Improvement: Major refactoring to bundled CMake build system. CMake can now be
|
||||
used to build all of the examples and the test suite. Thank you Thijs Wenker
|
||||
@@ -36,8 +40,7 @@ HEAD
|
||||
long response before their HTTP handler ends would result in a second set of
|
||||
HTTP headers being injected into the output. Thank you Kevin Smith for
|
||||
reporting and providing test case details. #443
|
||||
- Compatibility: Removes non-standards compliant masking behavior. Fixes #469,
|
||||
Fixes #395
|
||||
- Compatibility: Removes non-standards compliant masking behavior. #395, #469
|
||||
|
||||
0.6.0
|
||||
- MINOR BREAKING TRANSPORT POLICY CHANGE: Custom transport policies will now be
|
||||
|
||||
@@ -339,6 +339,28 @@ public:
|
||||
lib::asio::io_service & get_io_service() {
|
||||
return *m_io_service;
|
||||
}
|
||||
|
||||
/// Get local TCP endpoint
|
||||
/**
|
||||
* Extracts the local endpoint from the acceptor. This represents the
|
||||
* address that WebSocket++ is listening on.
|
||||
*
|
||||
* Sets a bad_descriptor error if the acceptor is not currently listening
|
||||
* or otherwise unavailable.
|
||||
*
|
||||
* @since 0.7.0
|
||||
*
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
* @return The local endpoint
|
||||
*/
|
||||
lib::asio::ip::tcp::endpoint get_local_endpoint(lib::asio::error_code & ec) {
|
||||
if (m_acceptor) {
|
||||
return m_acceptor->local_endpoint(ec);
|
||||
} else {
|
||||
ec = lib::asio::error::make_error_code(lib::asio::error::bad_descriptor);
|
||||
return lib::asio::ip::tcp::endpoint();
|
||||
}
|
||||
}
|
||||
|
||||
/// Set up endpoint for listening manually (exception free)
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user