From ad1e0bc855cfa418f1a297c64e44a8352e80c4ee Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 13 Jul 2017 15:57:32 -0700 Subject: udp: Added option to query local address of socket --- host/lib/transport/udp_zero_copy.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'host/lib/transport/udp_zero_copy.cpp') diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp index 814f41500..cd271eccf 100644 --- a/host/lib/transport/udp_zero_copy.cpp +++ b/host/lib/transport/udp_zero_copy.cpp @@ -244,7 +244,16 @@ public: size_t get_num_send_frames(void) const {return _num_send_frames;} size_t get_send_frame_size(void) const {return _send_frame_size;} - uint16_t get_local_port(void) const {return _socket->local_endpoint().port();} + + uint16_t get_local_port(void) const + { + return _socket->local_endpoint().port(); + } + + std::string get_local_addr(void) const + { + return _socket->local_endpoint().address().to_string(); + } private: //memory management -> buffers and fifos -- cgit v1.2.3