Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up"Reopening" socket with the same identity failed #2010
Comments
|
If I set |
|
You cannot use the same identity for two different peers. So the behavior is following:
Because you send the messages first and then read you get the first message with random identity. In general try not to use identity, it is kind of obsolete concept. |
|
Thanks! Than I close the issue. |
|
If Identity is an obsolete concept, what is there to take its place? (And why don't you remove/replace it in the router socket either?) |
|
Setting the identity is obsolete, instead identification of peer should be part of the handshake at the application level. New server socket type doesn't have identity anymore, routing id which is integer. I don't think we can remove it as alot of users are using it |
|
In this case if you have two backed router interfaces and one-to-one connection among client and services (I think this is typical in case of remote object calls) then you have to search connection about client and services twice: once in router socket (for low level socket selection by routing id) and once in the user created router code (replace routing id the the application level address). |
|
Is there anyway to detect the case where there are duplicate identities on either side of the connection? I've tried monitoring the connection and only see ACCEPTED for both connecting sockets. The only indication I have that there is a problem is missing expected log messages on the ROUTER side. |
Hello,
I wrote the attached example code. Shortly: it uses only one thread, and has 3 sockets. Parent socket lives through the whole running. Once that it is created, we call the sendMessage function twice. It creates a socket and send a message to parent (and after close the socket).
If I set the identity I get only one message, but if I don't set identity I get both messages. Is this a bug or a design behavior of ZeroMQ?