diff options
author | Dirk Huss <dirk_huss@mentor.com> | 2015-12-09 14:50:34 +0100 |
---|---|---|
committer | Dirk Huss <dirk_huss@mentor.com> | 2015-12-09 14:50:34 +0100 |
commit | 2b7442a4c2452f8f3bd9e0f09f829478256d39af (patch) | |
tree | e857c964b2a0a5d7e539efa00d17e6dccec5990a /implementation/endpoints/src | |
parent | 78be04b467566633318a277ccd2d968c1c4e46bf (diff) | |
download | vSomeIP-2b7442a4c2452f8f3bd9e0f09f829478256d39af.tar.gz |
vSomeIP 2.0.12.0.1
Diffstat (limited to 'implementation/endpoints/src')
3 files changed, 34 insertions, 8 deletions
diff --git a/implementation/endpoints/src/local_client_endpoint_impl.cpp b/implementation/endpoints/src/local_client_endpoint_impl.cpp index 323c414..116287f 100644 --- a/implementation/endpoints/src/local_client_endpoint_impl.cpp +++ b/implementation/endpoints/src/local_client_endpoint_impl.cpp @@ -38,14 +38,9 @@ void local_client_endpoint_impl::start() { void local_client_endpoint_impl::connect() {
socket_.open(remote_.protocol());
- socket_.async_connect(
- remote_,
- std::bind(
- &local_client_endpoint_base_impl::connect_cbk,
- shared_from_this(),
- std::placeholders::_1
- )
- );
+ boost::system::error_code error;
+ error = socket_.connect(remote_, error);
+ connect_cbk(error);
}
void local_client_endpoint_impl::receive() {
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; diff --git a/implementation/endpoints/src/udp_server_endpoint_impl.cpp b/implementation/endpoints/src/udp_server_endpoint_impl.cpp index f29dfba..4593c1f 100644 --- a/implementation/endpoints/src/udp_server_endpoint_impl.cpp +++ b/implementation/endpoints/src/udp_server_endpoint_impl.cpp @@ -123,6 +123,17 @@ udp_server_endpoint_impl::get_remote() const { return remote_; } +bool udp_server_endpoint_impl::get_remote_address( + boost::asio::ip::address &_address) const { + boost::asio::ip::address its_address = remote_.address(); + if (its_address.is_unspecified()) { + return false; + } else { + _address = its_address; + } + return true; +} + bool udp_server_endpoint_impl::get_multicast(service_t _service, event_t _event, udp_server_endpoint_impl::endpoint_type &_target) const { bool is_valid(false); |