summary refs log tree commit diff stats
path: root/lib/wrappers/zmq.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wrappers/zmq.nim')
-rwxr-xr-x[-rw-r--r--]lib/wrappers/zmq.nim27
1 files changed, 26 insertions, 1 deletions
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):