Welcome to the CHICKEN Scheme pasting service

Trying to get hello world for zmq working added by kiatoa on Sun Oct 21 20:46:16 2012

;;hwclient.scm
;;============

(use zmq posix)

(define s (make-socket 'req))
(connect-socket s "tcp://localhost:5555")

(print "Start client...")

(do ((i 0 (+ i 1)))
    ((>= i 10))
  (print "sending message #" i)
  (send-message s "Hello")
  (printf "Received reply ~a [~a]\n"
          i (receive-message s)))


;; hwserver.scm
;;=============

(use zmq srfi-18 posix)

(define s (make-socket 'rep))
(connect-socket s "tcp://localhost:5555")

(print "Start server...")
(let loop ()
  (printf "Received request: [~a]\n" (receive-message s))
  (thread-sleep! 1)
  (send-message s "World")
  (loop))

# script to run
#==============

#!/bin/bash

echo Compiling hwclient and hwserver
csc hwclient.scm
csc hwserver.scm

./hwserver &
sleep 1
./hwclient 

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What is the operator to construct pairs?
Visually impaired? Let me spell it for you (wav file) download WAV