Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

implement the LOCAL-LAT benchmark

  • Loading branch information...
commit 8c7fa64f9eb444ad2852ec8fdad1115893ecaf62 1 parent ab1f0b9
Nicolas Martyanoff authored October 03, 2011
13  examples/official-benchmarks.lisp
@@ -31,3 +31,16 @@
31 31
           ((= i message-count))
32 32
         (zmq:with-msg-init-size (message message-size)
33 33
           (zmq:send socket message))))))
  34
+
  35
+(defun local-lat (address message-size roundtrip-count)
  36
+  (zmq:with-context (context 1)
  37
+    (zmq:with-socket (socket context :rep)
  38
+      (zmq:bind socket address)
  39
+      (zmq:with-msg-init (message)
  40
+        (do ((i 0 (1+ i)))
  41
+            ((= i roundtrip-count))
  42
+          (zmq:recv socket message)
  43
+          (unless (eq (zmq:msg-size message) message-size)
  44
+            (error "Message of incorrect size ~A received."
  45
+                   (zmq:msg-size message)))
  46
+          (zmq:send socket message))))))
3  examples/packages.lisp
@@ -2,4 +2,5 @@
2 2
 (defpackage :zeromq-examples
3 3
   (:nicknames :zmq-examples)
4 4
   (:use :cl)
5  
-  (:export :local-thr))
  5
+  (:export :local-thr :remote-thr
  6
+           :local-lat))

0 notes on commit 8c7fa64

Please sign in to comment.
Something went wrong with that request. Please try again.