Add libzmq.so.3 since cl-zmq supports ZeroMQ3
[cl-zmq.git] / perf / local-lat-poll.lisp
blobf0a231c6722aa78a0eaf3e59bba99c97636dea1d
1 ;; Copyright (c) 2009, 2010 Vitaly Mayatskikh <v.mayatskih@gmail.com>
2 ;;
3 ;; This file is part of CL-ZMQ.
4 ;;
5 ;; Vitaly Mayatskikh grants you the rights to distribute
6 ;; and use this software as governed by the terms
7 ;; of the Lisp Lesser GNU Public License
8 ;; (http://opensource.franz.com/preamble.html),
9 ;; known as the LLGPL.
11 (asdf:oos 'asdf:load-op :zeromq)
13 (defpackage :zeromq-test
14 (:use :cl))
16 (in-package :zeromq-test)
18 (load "lat-parms")
20 (zmq:with-context (ctx 1)
21 (zmq:with-socket (s ctx zmq:rep)
22 (zmq:bind s *address*)
23 (let ((msg (make-instance 'zmq:msg)))
24 (zmq:with-polls ((poll-in . ((s . zmq:pollin)))
25 (poll-out . ((s . zmq:pollout))))
26 (dotimes (i *roundtrip-count*)
27 (zmq:poll poll-in)
28 (zmq:recv s msg zmq:noblock)
29 (zmq:poll poll-out)
30 (zmq:send s msg zmq:noblock))))))
32 (tg:gc)
33 #+sbcl (sb-ext:quit)
34 #+clisp (ext:quit)
35 #+ecl (ext:quit)