(bind-func fleet_message_node_sync
(let ((buf:i8* (zalloc FLEET_NANOMSG_CLIENT_BUFLEN)))
(lambda (msg:i8* sock:i32)
(let ((sz_msg (+ (strlen msg) 1))
(bytes (nn_send sock msg sz_msg 0)))
(nn_sock_set_timeout sock 1000)
(if (= bytes (convert sz_msg)) ;; should also check (< bytes (convert sz_msg))
(let ((rbytes (nn_recv sock buf FLEET_NANOMSG_CLIENT_BUFLEN 0)))
(if (> rbytes 0)
(begin (printf "%s\n" buf)
void)))
(nn_println_strerror "error in request"))))))