summaryrefslogtreecommitdiffstats
path: root/external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py
diff options
context:
space:
mode:
authorDan Klein <danklei@cisco.com>2015-08-24 17:28:17 +0300
committerDan Klein <danklei@cisco.com>2015-08-24 17:28:17 +0300
commit7d3be8c612e295820649779335288c197b80ccb2 (patch)
tree78e9636bc8780dedc919c30378a621f425e1cbfc /external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py
parentdab741a80699f86e86c91718872a052cca9bbb25 (diff)
Changes location of console and fixed dependencies
Diffstat (limited to 'external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py')
-rw-r--r--external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py b/external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py
deleted file mode 100644
index 797cb8c2..00000000
--- a/external_libs/python/pyzmq-14.7.0/examples/heartbeat/ping.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-"""For use with pong.py
-
-This script simply pings a process started by pong.py or tspong.py, to
-demonstrate that zmq remains responsive while Python blocks.
-
-Authors
--------
-* MinRK
-"""
-from __future__ import print_function
-
-import sys
-import time
-import numpy
-import zmq
-
-ctx = zmq.Context()
-
-req = ctx.socket(zmq.REQ)
-req.connect('tcp://127.0.0.1:10111')
-
-#wait for connects
-time.sleep(1)
-n=0
-while True:
- time.sleep(numpy.random.random())
- for i in range(4):
- n+=1
- msg = 'ping %i' % n
- tic = time.time()
- req.send_string(msg)
- resp = req.recv_string()
- print("%s: %.2f ms" % (msg, 1000*(time.time()-tic)))
- assert msg == resp