summaryrefslogtreecommitdiff
path: root/implementation/endpoints/src/udp_client_endpoint_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'implementation/endpoints/src/udp_client_endpoint_impl.cpp')
-rw-r--r--implementation/endpoints/src/udp_client_endpoint_impl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/implementation/endpoints/src/udp_client_endpoint_impl.cpp b/implementation/endpoints/src/udp_client_endpoint_impl.cpp
index 579805e..66aab17 100644
--- a/implementation/endpoints/src/udp_client_endpoint_impl.cpp
+++ b/implementation/endpoints/src/udp_client_endpoint_impl.cpp
@@ -137,7 +137,13 @@ unsigned short udp_client_endpoint_impl::get_local_port() const {
std::lock_guard<std::mutex> its_lock(socket_mutex_);
boost::system::error_code its_error;
if (socket_.is_open()) {
- return socket_.local_endpoint(its_error).port();
+ endpoint_type its_endpoint = socket_.local_endpoint(its_error);
+ if (!its_error) {
+ return its_endpoint.port();
+ } else {
+ VSOMEIP_WARNING << "udp_client_endpoint_impl::get_local_port() "
+ << " couldn't get local_endpoint: " << its_error.message();
+ }
}
return 0;
}