zeromq / zeromq3-x Goto Github PK
View Code? Open in Web Editor NEWØMQ/3.2 release branch - bug fixes only
License: GNU General Public License v3.0
ØMQ/3.2 release branch - bug fixes only
License: GNU General Public License v3.0
Welcome ------- The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more. Building and installation ------------------------- See the INSTALL file included with the distribution. Resources --------- Extensive documentation is provided with the distribution. Refer to doc/zmq.html, or "man zmq" after you have installed 0MQ on your system. Website: http://www.zeromq.org/ Development mailing list: [email protected] Announcements mailing list: [email protected] Git repository: http://github.com/zeromq/libzmq 0MQ developers can also be found on the IRC channel #zeromq, on the Freenode network (irc.freenode.net). Copying ------- Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` included with the 0MQ distribution.
Could we get a tag added for v3.2.3 please?
when execute command "make",out error info
make[1]: Entering directory /root/zeromq-3.2.3/tests' CXX test_connect_delay.o test_connect_delay.cpp:260:2: error: no newline at end of file make[1]: *** [test_connect_delay.o] Error 1 make[1]: Leaving directory
/root/zeromq-3.2.3/tests'
make: *** [all-recursive] Error 1
Windows XP
ZMQ 3.2 rc-1
after restart device i get this assert in worker (REP)
this is simple test
#include "zmq.h"
#include <process.h>
#include <windows.h>
#include <assert.h>
unsigned __stdcall echo_srv( void* ){
void *ctx = zmq_ctx_new();
void *skt = zmq_socket(ctx,ZMQ_REP);
assert(-1 != zmq_connect(skt, "tcp://127.0.0.1:5556"));
while(true){
zmq_msg_t msg;
assert(-1 != zmq_msg_init(&msg));
assert(-1 != zmq_msg_recv(&msg, skt,0));
assert(-1 != zmq_msg_send(&msg, skt,0));
zmq_msg_close(&msg);
}
zmq_close(skt);
zmq_ctx_destroy(ctx);
_endthreadex( 0 );
return 0;
}
void *context;
void *frontend;
void *backend;
unsigned __stdcall device( void* ){
context = zmq_ctx_new();
frontend = zmq_socket (context, ZMQ_ROUTER);
backend = zmq_socket (context, ZMQ_DEALER);
assert (backend);
assert (frontend);
// Bind both sockets to TCP ports
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
assert (zmq_bind (backend, "tcp://*:5556") == 0);
// Start a queue device
zmq_device (ZMQ_QUEUE, frontend, backend);
zmq_close(backend);
zmq_close(frontend);
zmq_ctx_destroy(context);
_endthreadex( 0 );
return 0;
}
void echo_cli(){
void *ctx = zmq_ctx_new();
void *skt = zmq_socket(ctx, ZMQ_REQ);
assert(-1 != zmq_connect(skt, "tcp://127.0.0.1:5555"));
zmq_msg_t msg;
assert(-1 != zmq_msg_init_size(&msg, 5));
memcpy(zmq_msg_data(&msg), "HELLO", 5);
assert(-1 != zmq_msg_send(&msg, skt, 0));
zmq_msg_close(&msg);
assert(-1 != zmq_msg_init(&msg));
assert(-1 != zmq_msg_recv(&msg, skt,0));
assert( 5 == zmq_msg_size(&msg));
assert( 0 == memcmp(zmq_msg_data(&msg), "HELLO", 5));
zmq_msg_close(&msg);
zmq_close(skt);
zmq_ctx_destroy(ctx);
}
int main(){
HANDLE DeviceThread; unsigned DeviceThreadID;
DeviceThread = (HANDLE)_beginthreadex( NULL, 0, &device, NULL, 0, &DeviceThreadID );
Sleep(500);
HANDLE EchoSrvThread; unsigned EchoSrvThreadID;
EchoSrvThread = (HANDLE)_beginthreadex( NULL, 0, &echo_srv, NULL, 0, &EchoSrvThreadID );
CloseHandle(EchoSrvThread);
Sleep(500);
echo_cli();
// restart device
TerminateThread(DeviceThread, -1);
WaitForSingleObject( DeviceThread, INFINITE );
CloseHandle(DeviceThread);
zmq_close(frontend);
zmq_close(backend);
zmq_ctx_destroy(context);
Sleep(1500);
DeviceThread = (HANDLE)_beginthreadex( NULL, 0, &device, NULL, 0, &DeviceThreadID );
Sleep(500); // assert it echo_srv while start device
echo_cli();
}
Hi all,
We are using 0mq and it crashes with the following details:
Unhandled exception at 0x00007FFCCA9395FC (KERNELBASE.dll) in [OURPROCESS].dmp: 0x40000015: %hs (parameters: 0x00000000522694C0).
libzmq.dll!zmq::mailbox_t::recv(zmq::command_t * cmd_, int timeout_) Line 86 C++
libzmq.dll!zmq::socket_base_t::process_commands(int timeout_, bool throttle_) Line 855 C++
libzmq.dll!zmq::socket_base_t::getsockopt(int option_, void * optval_, unsigned __int64 * optvallen_) Line 291 C++
libzmq.dll!zmq_poll(zmq_pollitem_t * items_, int nitems_, long timeout_) Line 892 C++
[OURPROCESS]::QPoller::Poll(__int64 timeout) Line 63 C++
Does anyone have any idea on what is going on ? The only thing that I can suspect is that for some reason the machine is running out of sockets. But after investigating the machine this seems unlikely.
The Windows version is Windows Server 2012 R2.
In the make check tests, if /tmp/testep exists but it not writeable by the user running the tests, the test "test_last_endpoint" fails without proper explanation.
Perhaps simple in the makefile for make check a warning could be issued in this instance before the tests run?
Hi,Sorry for my poor English!
This is a test main.c:
#include <zmq.h>
int main (void)
{
int major, minor, patch;
zmq_version (&major, &minor, &patch);
printf ("Current 0MQ version is %d.%d.%d\n", major, minor, patch);
return 0;
}
When I linked the libzmq.a(gcc main.c /usr/local/lib/libzmq.a),i get some errors(here is a part of errors) like:
/home/test1/armbuild/zeromq-3.2.4/src/ipc_connecter.cpp:116: undefined reference to `std::nothrow'
but i use :gcc main.c /usr/local/lib/libzmq.so
it works great,so how do i link the zmq static libraries?
When running autogen.sh on OSX with autoconf 2.69 & automake 1.13.1, autoconf complains
configure.in:13: error: 'AM_CONFIG_HEADER': this macro is obsolete.
You should use the 'AC_CONFIG_HEADERS' macro instead.
This indeed solves my problem, but it would probably break automake on other setups. Any thoughts how to fix this in a compatible way?
Fix the design of the ZMQ_FAIL_UNROUTABLE socket option to actually fail in a deterministic manner. Also, rework the feature to fail with a common EAGAIN error code, so that the common send() code in socket_base.cpp could detect it and use the block-with-timeout logic to wait for the unknown peer to appear.
Hi,
I'm trying to compile zeromq3 on Android things 1.06 under termux and receive the below.
The error references the function tempman, is there a suitable substitution to make? I'm thinking try the recommendation and do a PR.
zeromq3-x/src/ipc_listener.cpp
Line 124 in b56cb96
git clone https://github.com/zeromq/zeromq3-x.git
cd zeromq3-x/
./autogen.sh
./configure --enable-static --disable-shared --host=arm-linux-androideabi --prefix=$OUTPUT_DIR LDFLAGS="-L$OUTPUT_DIR/lib" CPPFLAGS="-fPIC -I$OUTPUT_DIR/include" LIBS="-lgcc"
make
make install
Making all in src
make[1]: Entering directory '/data/data/com.termux/files/home/zeromq3-x/src'
make all-am
make[2]: Entering directory '/data/data/com.termux/files/home/zeromq3-x/src'
CXX libzmq_la-address.lo
CXX libzmq_la-clock.lo
CXX libzmq_la-ctx.lo
CXX libzmq_la-decoder.lo
CXX libzmq_la-devpoll.lo
CXX libzmq_la-dist.lo
CXX libzmq_la-encoder.lo
CXX libzmq_la-epoll.lo
CXX libzmq_la-err.lo
CXX libzmq_la-fq.lo
CXX libzmq_la-io_object.lo
CXX libzmq_la-io_thread.lo
CXX libzmq_la-ip.lo
CXX libzmq_la-ipc_address.lo
CXX libzmq_la-ipc_connecter.lo
CXX libzmq_la-ipc_listener.lo
ipc_listener.cpp:124:17: error: 'tempnam' is deprecated: tempnam is unsafe, use
mkstemp or tmpfile instead [-Werror,-Wdeprecated-declarations]
addr_ = tempnam(NULL, NULL);
^
/data/data/com.termux/files/usr/include/stdio.h:173:5: note: 'tempnam' has been
explicitly marked deprecated here
__warnattr("tempnam is unsafe, use mkstemp or tmpfile instead");
^
/data/data/com.termux/files/usr/include/sys/cdefs.h:160:40: note: expanded from
macro '__warnattr'
#define __warnattr(msg) __attribute__((deprecated(msg)))
^
1 error generated.
make[2]: *** [Makefile:878: libzmq_la-ipc_listener.lo] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/zeromq3-x/src'
make[1]: *** [Makefile:590: all] Error 2
make[1]: Leaving directory '/data/data/com.termux/files/home/zeromq3-x/src'
make: *** [Makefile:418: all-recursive] Error 1
$ make install
Making install in src
make[1]: Entering directory '/data/data/com.termux/files/home/zeromq3-x/src'
CXX libzmq_la-ipc_listener.lo
ipc_listener.cpp:124:17: error: 'tempnam' is deprecated: tempnam is unsafe, use
mkstemp or tmpfile instead [-Werror,-Wdeprecated-declarations]
addr_ = tempnam(NULL, NULL);
^
/data/data/com.termux/files/usr/include/stdio.h:173:5: note: 'tempnam' has been
explicitly marked deprecated here
__warnattr("tempnam is unsafe, use mkstemp or tmpfile instead");
^
/data/data/com.termux/files/usr/include/sys/cdefs.h:160:40: note: expanded from
macro '__warnattr'
#define __warnattr(msg) __attribute__((deprecated(msg)))
^
1 error generated.
make[1]: *** [Makefile:878: libzmq_la-ipc_listener.lo] Error 1
make[1]: Leaving directory '/data/data/com.termux/files/home/zeromq3-x/src'
make: *** [Makefile:418: install-recursive] Error 1
does CMakeLists.txt work for *nix platform?
The formatting for ZMQ_DELAY_ATTACH_ON_CONNECT and ZMQ_FD seems broken. Also, using a recursive grep, I cannot find the constant ZMQ_DELAY_ATTACH_ON_CONNECT anywhere in the source tree.
Hi,
I have been working on porting pyzmq to Android (see work progress here: zeromq/pyzmq#227 (comment)). The symptoms without the patch are:
Starting from libzmq3.x (https://github.com/zeromq/zeromq3-x), the following patch that will add -avoid-version to LDFLAGS:
diff --git a/configure.in b/configure.in
index 7152015..60416ff 100644
--- a/configure.in
+++ b/configure.in
@@ -75,8 +75,9 @@ libzmq_werror="yes"
# By default use DSO visibility
libzmq_dso_visibility="yes"
-# Whether we are on mingw or not.
+# Whether we are on mingw or android or not.
libzmq_on_mingw32="no"
+libzmq_on_android="no"
# Set some default features required by 0MQ code.
CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"
@@ -96,6 +97,7 @@ case "${host_os}" in
case "${host_os}" in
*android*)
AC_DEFINE(ZMQ_HAVE_ANDROID, 1, [Have Android OS])
+ libzmq_on_android="yes"
;;
esac
;;
@@ -373,6 +375,7 @@ AC_LANG_POP([C++])
AM_CONDITIONAL(BUILD_PGM, test "x$libzmq_pgm_ext" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw32" = "xyes")
+AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes")
# Checks for library functions.
AC_TYPE_SIGNAL
diff --git a/src/Makefile.am b/src/Makefile.am
index c69a556..23c8cbe 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -138,8 +138,12 @@ libzmq_la_SOURCES = \
if ON_MINGW
libzmq_la_LDFLAGS = -no-undefined -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
else
+if ON_ANDROID
+libzmq_la_LDFLAGS = -avoid-version -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
+else
libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAGS@
endif
+endif
libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@
Then I also need to make use of that patch not yet released in 3.x: zeromq/libzmq@eb6c668
I have never made git pull request and do not have any folder on git... I will try to keep it that way for now, that's why I post my patch here.
EDITS:
Thanks for ZeroMQ!
I'm adding support for a new language, Julia: http://julialang.org/. Julia is a dynamic language that gets JIT-compiled by LLVM, achieving performance typical of C with all the nice features of a dynamic language. When linking to an external library like ZeroMQ, there's a zero-overhead "ccall" functionality, so that no C-wrapper needs to be written to access the library---calls to the library get compiled/linked inline via LLVM.
One of the things that would seem to make Julia's (and perhaps other languages?) ZeroMQ support cleaner would be to have the values of the various constants (e.g., all of the zmq_setsockopt options like ZMQ_SNDHWM) be exported to the library itself. We make no use of the zmq.h header, so we can't get the constants from there; currently the constants are (re)defined in Julia code (which may be true for quite a few other languages, too). Unfortunately, this introduces the risk that a constant might change its definition in some future version of ZeroMQ, and we'll then have problems.
This risk is avoided entirely if one can simply extract the values of constants from the library. I think this is possible if you use enum (or const int) rather than #define when specifying these constants. Would there be any downsides to making this switch? It might also help to have a constant for sizeof(zmq_msg_t), since currently Julia just allocates a blank buffer of the correct size and then has zmq_init* fill in the data.
If it would help to see our current code, it's here:
https://github.com/timholy/julia/tree/zmq/extras/zmq
The wrapper for ZeroMQ is just the one file, zmq.jl.
This patches tries to fix following compiler error with gcc 4.7.1/uClibc 0.9.33.2
on ARM (OpenWRT):
In file included from device.cpp:51:0:
socket_base.hpp:105:35: error: 'va_list' has not been declared
make[5]: *** [libzmq_la-device.lo] Error 1
diff --git a/src/socket_base.hpp b/src/socket_base.hpp
index 35d2962..f0ee671 100644
--- a/src/socket_base.hpp
+++ b/src/socket_base.hpp
@@ -25,6 +25,7 @@
#include <string>
#include <map>
+#include <cstdarg>
#include "own.hpp"
#include "array.hpp"
--
1.7.9.5
The downloads for ZeroMQ 3.2 are coming from download.zeromq.org
which is a CNAME to an iMatix VM. That VM is about to be shut down (somewhere between late May and mid-June). When that VM is shut down the downloads for ZeroMQ 3.2 will not work if they are not changed.
Suggested solution:
zeromq3-x
and upload ready-to-build archives (and/or manually upload the existing archives)Ewen
Hi.
I have meet a segfault with my program.
this situation like below.
zmq_poll()
with a monitor socket gained by zmq_monitor_socket()
and then some callback is triggered.zmq_poll()
with same pollitems.I have rebuilt ZMQ::LibZMQ3 with ZMQ_TRACE
, and this is output from that.
[perlzmq (29306)] START mg_free (Message)
[perlzmq (29306)] + zmq message 2e41f50
[perlzmq (29306)] END mg_free (Message)
[perlzmq (29306)] START zmq_poll
[perlzmq (29306)] + processing element 0
[perlzmq (29306)] + mg 0: 48468640
[perlzmq (29306)] + mg->mg_ptr 0: 0
Segmentation fault (core dumped)
Actually... it may be my fault, too.
but I think that we can handle this situation more gracefully :)
Now we have
#include "../src/platform.hpp"
But we should use
#include "platform.hpp"
libzmq already do that.
Hello.
I have met a strange problem after I upgrade ZeroMQ 3.2.5 version from RPM.
when I call zmq_socket_monitor()
, eventfd has increased permanently even if the socket connected to monitor is closed.
So I downgrade it to 3.2.4 with RPM, after that It is disappeared :-/
Could you please let me know how can I trace this problem little a bit?
As I am using CMake to manage my project, it is good to integrate the CMake building process into my project. However, the CMake file contains several errors which make it impossible to compile. Please fix.
In source file pgm_socket.cpp at line 89 is a variable declaration "sa_family_t sa_family;". This variable is not used. This causes a compilation warning when --enable-pgm has been specified. Since -Werror is the default, this causes an error.
Hello,
Issue #1264 (zeromq/libzmq#1264) also exists on 3.2.4.
Mentionned issue gives example and details.
BR.
The source file tests/test_monitor.cpp doesn't have a newline as its last character. This causes a compilation warning. Since -Werror is the default, that causes an error.
Right now this repository lacks a Visual Studio 2012 solution. I had to upgrade the 2010 solution to build zeromq. It would be great if someone commited one.
Thanks
According to the NEWS file, these were intended to go into 3.2.2, but src/xsub.cpp does not reflect the changes.
500f6cffe36504a70980a1ac4904fe4e9c3b727c patch for issue 456
0bf8a4d2d2474a738f883db718a4d65beb7138e9 Code formatting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.