Description
I've been running into an issue lately where the hw{client,server}_msg
called from test_build.sh are hanging.
I can see from the output of netstat
that there is already some process listening at localhost:5555
.
I'm not very familiar with the details of zmq/f77zmq, so I'm not sure what the best solution would be (or even whether I've diagnosed the problem correctly).
I thought maybe I could check to see whether the requested address is in use and then use another one if it's not available (maybe just increment by 1 until an open one is found, and then dump that address to a text file somewhere to be read by hwclient_msg
), but I'm not sure I'm using the f77_zmq/zmq interface correctly.
It looks like zmq_bind
should return nonzero if the requested address is already in use, so tried to catch those cases.
I added variables integer errno
and character*(64) strerr
, and then after each function that should return 0 if things are working,
I added something like:
if (rc /= 0) then
errno = f77_zmq_errno()
strerr = f77_zmq_strerror(errno)
print*,'errno = ',errno
print*,'strerr - ',strerr
print*, 'f77_zmq_bind failed'
endif
What I see now is that f77_zmq_recv is returning nonzero, but the strerror is printed as @
, so I think I've done something incorrectly there (the errno is 11
).
The second f77_zmq_bind
is also returning nonzero (with errno = 98
and strerr = @$
)
Are you familiar with the zmq_strerror
interface? I think if I can figure out how to use that correctly it would help in coming up with a solution.
I'm using v4.3.2 of f77_zmq
(from qp2-dependencies), so it's not quite the latest version, but I don't see any changes since then that look like they would affect this issue.