I believe there is no way to query what type a socket is; is this right?

 

I could use such a function and can think of a couple of use cases. One
of them would be adding many sockets (of possibly different types) to a
collection, and then iterating over that collection and taking action on
the sockets depending on their type.

 

I don't think zmq_getsockopt() would be a good fit for such a
functionality, because it might convey the idea that you could also
change the type with an equivalent call to zmq_setsockopt(). Unless we
want to add this capability... (I doubt it).

 

Would there be interest in adding a function that returned this
information? Something like:

 

int zmq_socket_type(void* socket);

 

It could return -1 on error (and maybe set errno to EINVAL), or the
appropriate socket type for the given socket.

 

 

Gonzalo Diethelm 

 


_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to