Commit 4fe5bec6 authored by Julian Taylor's avatar Julian Taylor

Import pyzmq_15.4.0.orig.tar.gz

parent c4dfc7e6
......@@ -20,3 +20,5 @@ MANIFEST
examples/security/public_keys
examples/security/private_keys
wheelhouse
.coverage
.cache
......@@ -11,14 +11,14 @@ env:
- ZMQ=
- ZMQ=bundled
before_install:
- sudo add-apt-repository -y ppa:shnatsel/dnscrypt
- sudo add-apt-repository -y ppa:anton+/dnscrypt
- sudo apt-get update
- 'if [[ $ZMQ != bundled ]]; then sudo apt-get install -y -qq libzmq3-dev libsodium-dev; fi'
- 'if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then wget https://github.com/minrk/travis-wheels/archive/master.zip -O wheels.zip && unzip wheels.zip; fi'
- 'if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then pip install -q -f travis-wheels-master/wheelhouse cython; fi'
- 'if [[ ! -z "$ZMQ" && $ZMQ != bundled ]]; then wget https://github.com/zeromq/$ZMQ/archive/master.zip -O libzmq.zip && unzip libzmq.zip; fi'
- 'if [[ ! -z "$ZMQ" && $ZMQ != bundled ]]; then sh -c "set -x; cd $ZMQ-master; sh autogen.sh; ./configure; make -j; sudo make install; sudo ldconfig"; fi'
- pip install -q -f file://travis-wheels-master/wheelhouse -r test-requirements.txt
- pip install -f file://travis-wheels-master/wheelhouse -r test-requirements.txt
install:
- 'if [[ ! -z "$ZMQ" && $ZMQ != bundled ]]; then export ZMQ=/usr/local; fi'
......@@ -50,4 +50,4 @@ matrix:
- env: ZMQ=libzmq
- python: nightly
script: python setup.py test
script: travis_retry python setup.py test
......@@ -20,13 +20,11 @@ prune docs/gh-pages
include bundled/zeromq/COPYING
graft bundled/zeromq/include
graft bundled/zeromq/src
graft bundled/zeromq/tweetnacl
include bundled/zeromq/builds/msvc/platform.hpp
exclude bundled/zeromq/src/Makefile*
exclude bundled/zeromq/src/platform.hpp
include bundled/libsodium/LICENSE
graft bundled/libsodium/src
graft buildutils
graft examples
graft zmq
......
......@@ -2,10 +2,13 @@
[![Build Status](https://travis-ci.org/zeromq/pyzmq.svg?branch=master)](https://travis-ci.org/zeromq/pyzmq)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/ugoid0r2fnq8sr56/branch/master?svg=true)](https://ci.appveyor.com/project/minrk/pyzmq/branch/master)
This package contains Python bindings for [ØMQ](http://www.zeromq.org).
ØMQ is a lightweight and fast messaging implementation.
PyZMQ should work with any Python ≥ 2.6 (including Python 3), as well as PyPy.
PyZMQ should work with any reasonable version of Python (≥ 3.4),
as well as Python ≥ 2.6 and ≥ 3.2, as well as PyPy.
The Cython backend used by CPython supports libzmq ≥ 2.1.4 (including 3.2.x and 4.x),
but the CFFI backend used by PyPy only supports libzmq ≥ 3.2.2 (including 4.x).
......@@ -14,7 +17,7 @@ For a summary of changes to pyzmq, see our
### ØMQ 3.x, 4.x
PyZMQ ≥ 2.2.0 fully supports the 3.x and 4.x APIs of libzmq,
PyZMQ fully supports the 3.x and 4.x APIs of libzmq,
developed at [zeromq/libzmq](https://github.com/zeromq/libzmq).
No code to change, no flags to pass,
just build pyzmq against the latest and it should work.
......@@ -24,7 +27,7 @@ PyZMQ does not support the old libzmq 2 API on PyPy.
## Documentation
See PyZMQ's Sphinx-generated
[documentation](http://zeromq.github.com/pyzmq) on GitHub for API
[documentation](https://zeromq.github.io/pyzmq) on GitHub for API
details, and some notes on Python and Cython development. If you want to
learn about using ØMQ in general, the excellent [ØMQ
Guide](http://zguide.zeromq.org/py:all) is the place to start, which has a
......@@ -35,8 +38,8 @@ Python version of every example. We also have some information on our
Unless you specifically want to develop PyZMQ, we recommend downloading
the PyZMQ source code or wheels from
[PyPI](http://pypi.python.org/pypi/pyzmq). On Windows, you can get `.exe` installers
from [Christoph Gohlke](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyzmq).
[PyPI](https://pypi.io/projects/pyzmq),
or install with conda.
You can also get the latest source code from our GitHub repository, but
building from the repository will require that you install Cython
......@@ -46,12 +49,12 @@ version 0.16 or later.
For more detail on building pyzmq, see [our Wiki](https://github.com/zeromq/pyzmq/wiki/Building-and-Installing-PyZMQ).
We build wheels for OS X and Windows, so you can get a binary on those platforms with:
We build wheels for OS X, Windows, and Linux, so you can get a binary on those platforms with:
pip install pyzmq
but compiling from source with `pip install pyzmq` should work in most environments.
Especially on OS X, make sure you are using the latest pip (≥ 6), or it may not find the right wheels.
Especially on OS X, make sure you are using the latest pip (≥ 8), or it may not find the right wheels.
If the wheel doesn't work for some reason, or you want to force pyzmq to be compiled
(this is often preferable if you already have libzmq installed and configured the way you want it),
......
# mostly copied from
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\tools\\run_with_env.cmd"
matrix:
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: 32
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: 64
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: 32
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x"
PYTHON_ARCH: 64
- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: 32
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4.x"
PYTHON_ARCH: 64
matrix:
fast_finish: true
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""
- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "%CMD_IN_ENV% pip install --disable-pip-version-check --user --upgrade pip setuptools wheel cython"
build_script:
# Build the compiled extension
- "%CMD_IN_ENV% python setup.py bdist_wheel --zmq=bundled"
- ps: "ls dist"
- forfiles /p dist /m *.whl /c "cmd /c pip install @path"
test_script:
# Run the project tests
- ps: cmd /c 'cd dist & python -c "import zmq; print(zmq.zmq_version())"'
after_test:
# If tests are successful, create binary packages for the project.
- ps: "ls dist"
artifacts:
# Archive the generated packages in the ci.appveyor.com build report.
- path: dist\*
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
#
\ No newline at end of file
......@@ -14,7 +14,6 @@ import shutil
import stat
import sys
import tarfile
from glob import glob
import hashlib
from subprocess import Popen, PIPE
......@@ -33,15 +32,16 @@ pjoin = os.path.join
# Constants
#-----------------------------------------------------------------------------
bundled_version = (4,1,2)
libzmq = "zeromq-%i.%i.%i.tar.gz" % (bundled_version)
libzmq_url = "http://download.zeromq.org/" + libzmq
libzmq_checksum = "sha256:f9162ead6d68521e5154d871bac304f88857308bb02366b81bb588497a345927"
libsodium_version = (1,0,3)
libsodium = "libsodium-%i.%i.%i.tar.gz" % (libsodium_version)
libsodium_url = "https://github.com/jedisct1/libsodium/releases/download/%i.%i.%i/" % libsodium_version + libsodium
libsodium_checksum = "sha256:cbcfc63cc90c05d18a20f229a62c7e7054a73731d0aa858c0517152c549b1288"
bundled_version = (4,1,5)
vs = '%i.%i.%i' % bundled_version
libzmq = "zeromq-%s.tar.gz" % vs
libzmq_url = "https://github.com/zeromq/zeromq{major}-{minor}/releases/download/v{vs}/{libzmq}".format(
major=bundled_version[0],
minor=bundled_version[1],
vs=vs,
libzmq=libzmq,
)
libzmq_checksum = "sha256:04aac57f081ffa3a2ee5ed04887be9e205df3a7ddade0027460b8042432bdbcf"
HERE = os.path.dirname(__file__)
ROOT = os.path.dirname(HERE)
......@@ -50,7 +50,6 @@ ROOT = os.path.dirname(HERE)
# Utilities
#-----------------------------------------------------------------------------
def untgz(archive):
return archive.replace('.tar.gz', '')
......@@ -96,37 +95,6 @@ def fetch_archive(savedir, url, fname, checksum, force=False):
dest, scheme, digest_ref, digest))
return dest
#-----------------------------------------------------------------------------
# libsodium
#-----------------------------------------------------------------------------
def fetch_libsodium(savedir):
"""download and extract libsodium"""
dest = pjoin(savedir, 'libsodium')
if os.path.exists(dest):
info("already have %s" % dest)
return
path = fetch_archive(savedir, libsodium_url, fname=libsodium, checksum=libsodium_checksum)
tf = tarfile.open(path)
with_version = pjoin(savedir, tf.firstmember.path)
tf.extractall(savedir)
tf.close()
# remove version suffix:
shutil.move(with_version, dest)
def stage_libsodium_headers(libsodium_root):
"""stage configure headers for libsodium"""
src_dir = pjoin(HERE, 'include_sodium')
dest_dir = pjoin(libsodium_root, 'src', 'libsodium', 'include', 'sodium')
for src in glob(pjoin(src_dir, '*.h')):
base = os.path.basename(src)
dest = pjoin(dest_dir, base)
if os.path.exists(dest):
info("already have %s" % base)
continue
info("staging %s to %s" % (src, dest))
shutil.copy(src, dest)
#-----------------------------------------------------------------------------
# libzmq
#-----------------------------------------------------------------------------
......
......@@ -93,6 +93,7 @@ def get_cfg_args():
'no_libzmq_extension',
'have_sys_un_h',
'skip_check_zmq',
'bundle_msvcp',
]:
if key in g:
g[key] = eval(g[key])
......@@ -144,6 +145,7 @@ def discover_settings(conf_base=None):
'no_libzmq_extension': False,
'skip_check_zmq': False,
'allow_legacy_libzmq': False,
'bundle_msvcp': None,
'build_ext': {},
'bdist_egg': {},
}
......
......@@ -67,7 +67,7 @@
/* #undef HAVE_LIBSOCKET */
/* The libsodium library is to be used. */
#define HAVE_LIBSODIUM 1
/* #undef HAVE_LIBSODIUM */
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
/* #undef HAVE_LIBWS2_32 */
......
......@@ -67,7 +67,7 @@
/* #undef HAVE_LIBSOCKET */
/* The libsodium library is to be used. */
#define HAVE_LIBSODIUM 1
/* #undef HAVE_LIBSODIUM */
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
/* #undef HAVE_LIBWS2_32 */
......
#ifndef crypto_scalarmult_curve25519_H
#define crypto_scalarmult_curve25519_H
#if 0
# ifndef SODIUM_HAVE_TI_MODE
# define SODIUM_HAVE_TI_MODE
# endif
#endif
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#define crypto_scalarmult_curve25519_BYTES 32
SODIUM_EXPORT
size_t crypto_scalarmult_curve25519_bytes(void);
#define crypto_scalarmult_curve25519_SCALARBYTES 32
SODIUM_EXPORT
size_t crypto_scalarmult_curve25519_scalarbytes(void);
SODIUM_EXPORT
int crypto_scalarmult_curve25519(unsigned char *,const unsigned char *,const unsigned char *);
SODIUM_EXPORT
int crypto_scalarmult_curve25519_base(unsigned char *,const unsigned char *);
#ifdef SODIUM_HAVE_TI_MODE
# define crypto_scalarmult_curve25519_donna_c64 crypto_scalarmult_curve25519
# define crypto_scalarmult_curve25519_donna_c64_base crypto_scalarmult_curve25519_base
#else
# define crypto_scalarmult_curve25519_ref crypto_scalarmult_curve25519
# define crypto_scalarmult_curve25519_ref_base crypto_scalarmult_curve25519_base
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef crypto_stream_salsa20_H
#define crypto_stream_salsa20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#if 0
# ifndef SODIUM_HAVE_AMD64_ASM
# define SODIUM_HAVE_AMD64_ASM
# endif
#endif
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#define crypto_stream_salsa20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_salsa20_keybytes(void);
#define crypto_stream_salsa20_NONCEBYTES 8U
SODIUM_EXPORT
size_t crypto_stream_salsa20_noncebytes(void);
SODIUM_EXPORT
const char * crypto_stream_salsa20_primitive(void);
SODIUM_EXPORT
int crypto_stream_salsa20(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
SODIUM_EXPORT
int crypto_stream_salsa20_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
#ifdef SODIUM_HAVE_AMD64_ASM
# define crypto_stream_salsa20_amd64_xmm6 crypto_stream_salsa20
# define crypto_stream_salsa20_amd64_xmm6_xor crypto_stream_salsa20_xor
#else
# define crypto_stream_salsa20_ref crypto_stream_salsa20
# define crypto_stream_salsa20_ref_xor crypto_stream_salsa20_xor
#endif
#ifdef __cplusplus
}
#endif
#endif
#ifndef __SODIUM_VERSION_H__
#define __SODIUM_VERSION_H__
#include "export.h"
#define SODIUM_VERSION_STRING "0.4.5"
#define SODIUM_LIBRARY_VERSION_MAJOR 4
#define SODIUM_LIBRARY_VERSION_MINOR 4
#ifdef __cplusplus
extern "C" {
#endif
SODIUM_EXPORT
const char *sodium_version_string(void);
SODIUM_EXPORT
int sodium_library_version_major(void);
SODIUM_EXPORT
int sodium_library_version_minor(void);
#ifdef __cplusplus
}
#endif
#endif
/*
This file is from pyzmq-static by Brandon Craig-Rhodes,
and used under the BSD license
py3compat from http://wiki.python.org/moin/PortingExtensionModulesToPy3k
Provide the init function that Python expects
when we compile libsodium by pretending it is a Python extension.
*/
#include "Python.h"
static PyMethodDef Methods[] = {
{NULL, NULL, 0, NULL}
};
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"libsodium",
NULL,
-1,
Methods,
NULL,
NULL,
NULL,
NULL
};
PyMODINIT_FUNC
PyInit_libsodium(void)
{
PyObject *module = PyModule_Create(&moduledef);
return module;
}
#else // py2
PyMODINIT_FUNC
initlibsodium(void)
{
(void) Py_InitModule("libsodium", Methods);
}
#endif
cdef extern from "zmq.h" nogil:
enum: PYZMQ_DRAFT_API
{ZMQ_ENUMS}
......@@ -2,11 +2,14 @@
# Python module level constants
#-----------------------------------------------------------------------------
DRAFT_API = PYZMQ_DRAFT_API
{ASSIGNMENTS}
#-----------------------------------------------------------------------------
# Symbols to export
#-----------------------------------------------------------------------------
__all__ = [
"DRAFT_API",
{ALL}
]
#ifndef _PYZMQ_CONSTANT_DEFS
#define _PYZMQ_CONSTANT_DEFS
#ifdef ZMQ_BUILD_DRAFT_API
#define PYZMQ_DRAFT_API 1
#else
#define PYZMQ_DRAFT_API 0
#endif
{ZMQ_IFNDEFS}
#endif // ifndef _PYZMQ_CONSTANT_DEFS
......@@ -11,6 +11,7 @@
zmq
zmq.devices
zmq.decorators
zmq.green
zmq.eventloop.ioloop
zmq.eventloop.future
......
decorators
==========
Module: :mod:`zmq.decorators`
-----------------------------
.. automodule:: zmq.decorators
.. currentmodule:: zmq.decorators
Decorators
----------
.. autofunction:: zmq.decorators.context
.. autofunction:: zmq.decorators.socket
......@@ -6,8 +6,36 @@
Changes in PyZMQ
================
This is a coarse summary of changes in pyzmq versions. For a real changelog, consult the
`git log <https://github.com/zeromq/pyzmq/commits>`_
This is a coarse summary of changes in pyzmq versions.
For a full changelog, consult the `git log <https://github.com/zeromq/pyzmq/commits>`_.
15.4
====
- Load bundled libzmq extension with import rather than CDLL,
which should fix some manifest issues in certain cases on Windows.
- Avoid installing asyncio sources on Python 2, which confuses some tools that run `python -m compileall`, which reports errors on the Python 3-only files.
- Bundle msvcp.dll in Windows wheels on CPython 3.5,
which should fix wheel compatibility systems without Visual C++ 2015 redistributable.
- :meth:`zmq.Context.instance` is now threadsafe.
- FIX: sync some behavior in zmq_poll and setting LINGER on close/destroy with the CFFI backend.
- PERF: resolve send/recv immediately if events are available in async Sockets
- Async Sockets (asyncio, tornado) now support ``send_json``, ``send_pyobj``, etc.
- add preliminary support for ``zmq.DRAFT_API`` reflecting ZMQ_BUILD_DRAFT_API,
which indicates whether new APIs in prereleases are available.
15.3
====
- Bump bundled libzmq to 4.1.5, using tweetnacl for bundled curve support instead of libsodium
- FIX: include .pxi includes in installation for consumers of Cython API
- FIX: various fixes in new async sockets
- Introduce :mod:`zmq.decorators` API for decorating functions to create sockets or contexts
- Add :meth:`zmq.Socket.subscribe` and :meth:`zmq.Socket.unsubscribe` methods to sockets, so that assignment is no longer needed for subscribing. Verbs should be methods!
Assignment is still supported for backward-compatibility.
- Accept text (unicode) input to z85 encoding, not just bytes
- :meth:`zmq.Context.socket` forwards keyword arguments to the :class:`Socket` constructor
15.2
====
......
......@@ -6,6 +6,26 @@
Eventloops and PyZMQ
====================
Integrating zmq with eventloops is *almost* really easy,
since most eventloops happily support sockets.
What gets messy is that zmq sockets aren't regular sockets,
so they need special handling.
libzmq provides a :func:`zmq_poll` function that is the same as regular polling,
but **also** support zmq sockets. PyZMQ wrapps this in a :class:`~.Poller` class.
Most of pyzmq's eventloop support involves setting up existing eventloops (tornado, asyncio)
to use :func:`zmq_poll` as the inner poller, rather than the default select/poll/etc.
Once that's done, zmq sockets can be happily treated like regular sockets,
and regular sockets should continue to work as before.
.. note::
It *is* possible to integrate zmq sockets into existing eventloops without modifying the poller
by using the ``socket.FD`` attribute.
The incredibly unfortunate aspect of this is that it was implemented as an edge-triggered fd,
which is highly error prone, and I wouldn't recommend using unless absolutely necessary.
This is used in :mod:`zmq.green`, and has been the source of many problems.
Tornado IOLoop
==============
......
......@@ -10,14 +10,14 @@ PyZMQ Documentation
:Date: |today|
PyZMQ is the Python bindings for ØMQ_. This
documentation currently contains notes on some important aspects of developing PyZMQ and
PyZMQ is the Python bindings for ØMQ_.
This documentation currently contains notes on some important aspects of developing PyZMQ and
an overview of what the ØMQ API looks like in Python. For information on how to use
ØMQ in general, see the many examples in the excellent `ØMQ Guide`_, all of which
have a version in Python.
PyZMQ works with Python 3 (≥ 3.2), and Python 2 (≥ 2.6), with no transformations or 2to3,
as well as PyPy (at least 2.0 beta), thanks to a new CFFI backend.
as well as PyPy (at least 2.0 beta), via CFFI.
Please don't hesitate to report pyzmq-specific issues to our tracker_ on GitHub.
General questions about ØMQ are better sent to the ØMQ `mailing list`_ or `IRC Channel`_.
......@@ -41,7 +41,7 @@ but only the functionality of the linked libzmq will be available.
Binary distributions (wheels on `PyPI <http://pypi.python.org/pypi/pyzmq>`__
or `GitHub <https://www.github.com/zeromq/pyzmq/downloads>`__) of PyZMQ ship with
the stable version of libzmq at the time of release, built with default configuration,
and include libsodium for security.
and include CURVE support provided by tweetnacl.
For pyzmq-|release|, this is |target_libzmq|.
Using PyZMQ
......
"""Example showing ZMQ with asyncio and tornadoweb integration."""
# Copyright (c) PyZMQ Developers.
# This example is in the public domain (CC-0)
import asyncio
import zmq.asyncio
from tornado.ioloop import IOLoop
from tornado.platform.asyncio import AsyncIOMainLoop
# Tell asyncio to use zmq's eventloop
zmq.asyncio.install()
# Tell tornado to use asyncio
AsyncIOMainLoop().install()
# This must be instantiated after the installing the IOLoop
queue = asyncio.Queue()
ctx = zmq.asyncio.Context()
async def pushing():
server = ctx.socket(zmq.PUSH)
server.bind('tcp://*:9000')
while True:
await server.send(b"Hello")
await asyncio.sleep(1)
async def pulling():
client = ctx.socket(zmq.PULL)
client.connect('tcp://127.0.0.1:9000')
while True:
greeting = await client.recv()
print(greeting)
def zmq_tornado_loop():
loop = IOLoop.current()
loop.spawn_callback(pushing)
loop.spawn_callback(pulling)
loop.start()
if __name__ == '__main__':
zmq_tornado_loop()
"""A client for the device based server."""
#
# Copyright (c) 2010 Brian E. Granger and Eugene Chernyshov
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# pyzmq is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import zmq
import os
from time import time
print 'Client', os.getpid()
context = zmq.Context(1)
socket = context.socket(zmq.REQ)
socket.connect('tcp://127.0.0.1:5555')
while True:
data = zmq.Message(str(os.getpid()))
start = time()
socket.send(data)
data = socket.recv()
print time()-start, data
"""Demonstrate usin zmq.proxy device for message relay"""
# This example is places in the Public Domain
# It may also be used under the Creative Commons CC-0 License, (C) PyZMQ Developers
from __future__ import print_function
from threading import Thread
import time
import zmq
MSGS = 10
PRODUCERS = 2
def produce(url, ident):
"""Produce messages"""