ROUTER/DEALER report socket type as XREP/XREQ

Description

router.getsockopt(TYPE) returns 6 (XREP), and dealer.getsockopt(TYPE) returns 5 (XREQ) in libzmq-3.0 git. So ROUTER/DEALER and XREP/XREQ sockets are indistinguishable.

Example in C:

These would appear to be the only cases.

Environment

OSX 10.7, llvm-gcc-4.2, etc., libzmq-3.0 git.

Activity

Show:

PieterP September 6, 2011 at 1:32 PM

Ah, ok. In fact we don't use that behavior anywhere afaik, and it's not documented, so doesn't merit any special status.

Martin Sustrik September 6, 2011 at 1:18 PM

The semantics are not exactly the same. For example XREP socket drops the queued requests from the peer that disconnects – assuming that there's nobody to receive replies anyway. ROUTER keeps the requests, preserving the 2.x behaviour.

PieterP September 6, 2011 at 1:12 PM

Patch applied to 3-0 master. However it's a little confusing to have both sets of names available, where ZMQ_XREP != ZMQ_ROUTER, but with exactly the same semantics.

It's still unclear to me what the "device API" is meant to be, where this is defined, who is expected to use it, when, etc. "All socket types starting with X are for internal use in devices only" isn't really sufficient.

Martin Sustrik September 6, 2011 at 7:29 AM

Patch sent to the mailing list.

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

Created September 4, 2011 at 9:15 PM
Updated September 6, 2011 at 1:32 PM
Resolved September 6, 2011 at 1:12 PM