       (identify socket (str (.nextLong rdn) "-" (.nextLong rdn) n))))
   ([#^ZMQ$Socket socket]
      (set-id socket 0)))
+

            result))))
  ([#^ZMQ$Socket socket]
     ;; FIXME: Is this actually the flag I want?
     (recv-all socket +send-more+)))

(defn recv-str
  ([#^ZMQ$Socket socket]

     (try ~@body
          (finally (.term ~id)))))

(def const {
            ;; Non-blocking send/recv
            :no-block ZMQ/NOBLOCK
            :dont-wait ZMQ/DONTWAIT

            ;; More message parts are coming
            :sndmore ZMQ/SNDMORE
            :send-more ZMQ/SNDMORE
            :send-more ZMQ/SNDMORE

            ;;; Socket types

            ;; Request/Reply
            :req ZMQ/REQ
            :rep ZMQ/REP

            ;; Publish/Subscribe
            :pub ZMQ/PUB
            :sub ZMQ/SUB

            ;; Extended Publish/Subscribe
            :x-pub ZMQ/XPUB
            :x-sub ZMQ/XSUB
            ;; Push/Pull
            
            :push ZMQ/PUSH
            :pull ZMQ/PULL

            ;; Internal 1:1
            :pair ZMQ/PAIR

            ;; Router/Dealer

            ;; Creates/consumes request-reply routing envelopes.
            ;; Lets you route messages to specific connections if you
            ;; know their identities.
            :router ZMQ/ROUTER

            ;; Combined ventilator/sink.
            ;; Does load balancing on output and fair-queuing on input.
            ;; Can shuffle messages out to N nodes then shuffle the replies back.
            ;; Raw bidirectional async pattern.
            :dealer ZMQ/DEALER

            ;; Obsolete names for Router/Dealer
            :xreq ZMQ/XREQ
            :xrep ZMQ/XREP})

(defn socket
  [#^ZMQ$Context context type]
