I am trying to write a dynamic module for zeromq. It works when I test it in batch mode, but not interactively. The layout of the test is that I run a server (https://github.com/jkitchin/emacs-modules/blob/master/zeromq/hwserver.c) that just returns the string "World" for every request. This works.
The module defines a function https://github.com/jkitchin/emacs-modules/blob/master/zeromq/mod-zmq.c that is registered in Emacs as zmq-send-and-recv which takes one string argument, sends it to the server, and gets a request. I can see that the argument is sent to the server correctly, and when I test it in a batch mode (eg make test in https://github.com/jkitchin/emacs-modules/blob/master/zeromq/makefile), it appears to get the response back correctly too.
But If I try to run this interactively from emacs, e.g the first source block in https://github.com/jkitchin/emacs-modules/blob/master/zeromq/zeromq.org, or running the code in https://github.com/jkitchin/emacs-modules/blob/master/zeromq/test.el the msg is sent to the server but I get empty strings back in Emacs.
I can't figure out any reason for this and wondered if anyone has any ideas on debugging it.