Commit 2b04946f authored by Simon Giesecke's avatar Simon Giesecke

Problem: code duplication around getsockname

Solution: also use get_socket_address from base class
parent c476cf3d
...@@ -111,13 +111,8 @@ int zmq::tipc_listener_t::set_address (const char *addr_) ...@@ -111,13 +111,8 @@ int zmq::tipc_listener_t::set_address (const char *addr_)
// If random Port Identity, update address object to reflect the assigned address // If random Port Identity, update address object to reflect the assigned address
if (_address.is_random ()) { if (_address.is_random ()) {
struct sockaddr_storage ss; struct sockaddr_storage ss;
#ifdef ZMQ_HAVE_VXWORKS const zmq_socklen_t sl = get_socket_address (&ss);
int sl = sizeof (ss); if (sl == 0)
#else
socklen_t sl = sizeof (ss);
#endif
int rc = getsockname (_s, (sockaddr *) &ss, &sl);
if (rc != 0)
goto error; goto error;
_address = tipc_address_t ((struct sockaddr *) &ss, sl); _address = tipc_address_t ((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