summaryrefslogtreecommitdiff
path: root/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/endpoints/src/tcp_server_endpoint_impl.cpp')
-rw-r--r--implementation/endpoints/src/tcp_server_endpoint_impl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/implementation/endpoints/src/tcp_server_endpoint_impl.cpp b/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
index 20391a0..0084d8e 100644
--- a/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
+++ b/implementation/endpoints/src/tcp_server_endpoint_impl.cpp
@@ -70,6 +70,26 @@ tcp_server_endpoint_impl::get_remote() const {
return current_->get_socket().remote_endpoint();
}
+bool tcp_server_endpoint_impl::get_remote_address(
+ boost::asio::ip::address &_address) const {
+
+ if (current_) {
+ boost::system::error_code its_error;
+ tcp_server_endpoint_impl::endpoint_type its_endpoint =
+ current_->get_socket().remote_endpoint(its_error);
+ if (its_error) {
+ return false;
+ } else {
+ boost::asio::ip::address its_address = its_endpoint.address();
+ if (!its_address.is_unspecified()) {
+ _address = its_address;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
bool tcp_server_endpoint_impl::get_multicast(service_t, event_t,
tcp_server_endpoint_impl::endpoint_type &) const {
return false;