Skip to content

Instantly share code, notes, and snippets.

@taksatou
Created April 18, 2014 16:17
Show Gist options
  • Save taksatou/11052243 to your computer and use it in GitHub Desktop.
Save taksatou/11052243 to your computer and use it in GitHub Desktop.
(defun server ()
(zmq:with-context (ctx)
(zmq:with-socket (socket ctx :rep)
(zmq:bind socket "tcp://127.0.0.1:5555")
(loop
(let ((query (make-instance 'zmq:msg)))
(zmq:recv socket query)
(let ((req-string (zmq:msg-data-as-string query)))
(format t "Recieved message: '~A'~%" req-string)
(zmq:send socket (make-instance 'zmq:msg :data req-string)) ))))))
(server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment