(bind-func nnsock_create
"return socket id (i32)"
(lambda (protocol timeout)
(let ((sock (nn_socket AF_SP protocol)))
(if (or (< sock 0)
(< (nnsock_set_timeout sock timeout) 0))
(nn_println_strerror "error creating socket"))
sock)))