cppzmq
cppzmq copied to clipboard
connected returns true even as soon as the socket is initialized
The connected() function compares the internal ptr to null to see if it is connected, but ptr is initialized in init(...) which is called during construction.
The name is badly chosen, the function determines whether the socket has not been closed (which could be termed "open", although libzmq does not use that term IIRC).
Querying whether a socket is connected in the sense that connect has been called is not possible to implement.
I suggest to deprecate the function.
An open () function could be added, but I am not sure if there are valid use cases.
+1 for deprecating the function