jzmq
jzmq copied to clipboard
connected but can not receive msgs in pair-pair pattern
we encountered a problem:
client of c++ binds to server of scala using jzmq, and the client also binds to another server of c++.
when the client is restarted, it connect to servers normally, but server of scala can not receive any msg, otherwise server of c++ is normal to receive msgs.
codes of scala are as following
val context = new ZContext
val in: ZMQ.Socket = {
val skt = context.createSocket(0) //pair
skt.bind(inConf.getOrElse("ipc:///data/soft/ai-access/access-server"))
skt
}
threadPool.submit {
new Runnable {
override def run(): Unit = {
try {
while (!Thread.currentThread.isInterrupted) {
val reply = in.recv(0)
// ....
}
} catch {
case ex: Exception =>
}
}
}
}