;; so we need to put it into a loop
(bind-func receiver_loop
(let ((buflen:i64 1024)
(buf:i8* (zalloc buflen))
(running 1))
(lambda ()
(println "starting receiver_loop...")
(let ((bytes -1))
(while (= running 1)
(set! bytes (nn_recv RECV_SOCKET buf buflen 0))
(if (> bytes 0)
(printf "message received: %s\n" buf)))
(println "stopping receiver_loop")))))