Commit e162c8bd authored by Simon Giesecke's avatar Simon Giesecke

Problem: code duplication around getsockname

Solution: also use get_socket_address from base class
parent 2b04946f
......@@ -153,15 +153,10 @@ void zmq::ipc_listener_t::in_event ()
int zmq::ipc_listener_t::get_address (std::string &addr_)
{
struct sockaddr_storage ss;
#ifdef ZMQ_HAVE_HPUX
int sl = sizeof (ss);
#else
socklen_t sl = sizeof (ss);
#endif
int rc = getsockname (_s, reinterpret_cast<sockaddr *> (&ss), &sl);
if (rc != 0) {
const zmq_socklen_t sl = get_socket_address (&ss);
if (sl == 0) {
addr_.clear ();
return rc;
return -1;
}
ipc_address_t addr (reinterpret_cast<struct sockaddr *> (&ss), sl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment