[zeromq-dev] STREAM socket not closing.

Matt Connolly matt.connolly at me.com
Fri Jan 10 07:10:11 CET 2014

Dear list,

I’m looking at using the STREAM socket to interface with some plain old TCP clients, however, there seems to be two things I’m missing:

1. How do I send a message to a client first? Once the client sends a message I can get the identity frame and use that to reply. How do I send a message before receiving any data?

2. Closing sockets. I see in the docs that a socket can be closed by sending the identity frame followed by a zero length frame. However, this does not seem to be working.

I’m expecting to successfully read 0 bytes from the TCP socket meaning that the connection was actively closed, and no error codes. Instead by TCP socket recv blocks forever. The only way I can get this to happen is to close the ZMQ socket, which is not possible when I am using bind and talking to multiple TCP clients.


More information about the zeromq-dev mailing list