Using JeroMQ in Matlab, my subscriber connection drops when I try to recv
a message. I have verified this with Wireshark. I also note that the closing of the TCP connection is initiated by my subscribing port, not the publishing port.
javaclasspath('jeromq-0.5.1.jar')
import org.zeromq.*;
ctx = zmq.Ctx();
socket = ctx.createSocket(ZMQ.SUB);
socket.connect('tcp://127.0.0.1:5996')
message = socket.recv(1) %this is when the connection gets dropped
Wireshark screenshot showing connection being closed
I don't know for sure if it would help, but I have investigated using this,
socket.setSocketOpt(ZMQ.ZMQ_TCP_KEEPALIVE,1)
but Matlab reports that ZMQ_TCP_KEEPALIVE is an unrecognized function or variable.
I am indebted to the folks on this thread for getting me started on the right foot with JeroMQ in Matlab.