1 ! Copyright (C) 2012 Eungju PARK.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: byte-arrays destructors formatting io kernel sequences
4 strings zeromq zeromq.ffi ;
5 IN: zeromq.examples.hwclient
10 "Connecting to hello world server…" print
11 ZMQ_REQ <zmq-socket> &dispose
12 dup "tcp://localhost:5555" zmq-connect
14 [ "Hello" dup rot "Sending %s %d...\n" printf
15 dupd >byte-array 0 zmq-send ]
16 [ [ dup 0 zmq-recv >string ] dip
17 "Received %s %d\n" printf flush ]