cppzmq icon indicating copy to clipboard operation
cppzmq copied to clipboard

connected returns true even as soon as the socket is initialized

Open mireaulf opened this issue 7 years ago • 2 comments

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.

mireaulf avatar Dec 10 '16 03:12 mireaulf

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.

sigiesec avatar Apr 04 '18 20:04 sigiesec

+1 for deprecating the function

kurdybacha avatar Apr 09 '18 21:04 kurdybacha