diff options
Diffstat (limited to 'lib/wrappers')
-rwxr-xr-x[-rw-r--r--] | lib/wrappers/sphinx.nim | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | lib/wrappers/zmq.nim | 27 |
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/wrappers/sphinx.nim b/lib/wrappers/sphinx.nim index a4fce0205..a4fce0205 100644..100755 --- a/lib/wrappers/sphinx.nim +++ b/lib/wrappers/sphinx.nim diff --git a/lib/wrappers/zmq.nim b/lib/wrappers/zmq.nim index 8ebda26f9..4e658028e 100644..100755 --- a/lib/wrappers/zmq.nim +++ b/lib/wrappers/zmq.nim @@ -27,7 +27,32 @@ ## Nimrod 0mq wrapper. This file contains the low level C wrappers as well as ## some higher level constructs. The higher level constructs are easily ## recognizable because they are the only ones that have documentation. - +## +## Example of a client: +## +## .. code-block:: nimrod +## import zmq +## +## var connection = zmq.open("tcp://localhost:5555", server=false) +## echo("Connecting...") +## for i in 0..10: +## echo("Sending hello...", i) +## send(connection, "Hello") +## var reply = receive(connection) +## echo("Received ...", reply) +## close(connection) +## +## Example of a server: +## +## .. code-block:: nimrod +## +## import zmq +## var connection = zmq.open("tcp://*:5555", server=true) +## while True: +## var request = receive(connection) +## echo("Received: ", request) +## send(connection, "World") +## close(connection) {.deadCodeElim: on.} when defined(windows): |