jzmq icon indicating copy to clipboard operation
jzmq copied to clipboard

connected but can not receive msgs in pair-pair pattern

Open yangelaboy opened this issue 3 years ago • 0 comments

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 =>
                }
            }
        }
    }

yangelaboy avatar Sep 09 '22 04:09 yangelaboy