Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into all_options

  • Loading branch information...
commit 252fb207a9482c7d507c0f46a0efdd7ec40d107b 2 parents 71a6eb6 + 66fd2f6
@AlexeyKupershtokh AlexeyKupershtokh authored
View
2  .travis.yml
@@ -17,4 +17,4 @@ before_install:
language: node_js
node_js:
- "0.8"
- - "0.9"
+ - "0.10"
View
21 History.md
@@ -1,29 +1,40 @@
+2.3.0 / 2013-03-15
+==================
+
+ * added: xpub/xsub socket types [xla]
+ * added: support for zmq_disconnect [matehat]
+ * added: LAST_ENDPOINT socket option [ronkorving]
+ * added: local/remote_lat local/remote_thr perf test [wavded]
+ * fixed: tests improved [qubyte, jeremybarnes, ronkorving]
+ * fixed: Node v0.9.4+ compatibility [mscdex]
+ * fixed: SNDHWM and RCVHWM options were given the wrong type [freehaha]
+ * removed: waf support [mscdex]
-2.2.0 / 2012-10-17
+2.2.0 / 2012-10-17
==================
* add support for pkg-config
* add libzmq 3.x support [aaudis]
* fix: prevent GC happening too soon for connect/bindSync
-2.1.0 / 2012-06-29
+2.1.0 / 2012-06-29
==================
* fix require() for 0.8.0
* change: use uv_poll in place of IOWatcher
* remove stupid engines field
-2.0.3 / 2012-03-14
+2.0.3 / 2012-03-14
==================
* Removed -Wall (libuv unused vars caused the build to fail...)
-2.0.2 / 2012-02-16
+2.0.2 / 2012-02-16
==================
* Added back `.createSocket()` for BC. Closes #86
-2.0.1 / 2012-01-26
+2.0.1 / 2012-01-26
==================
* Added `.zmqVersion` [patricklucas]
View
2  Makefile
@@ -20,6 +20,6 @@ docclean:
rm -fr docs/index.{json,html}
distclean:
- node-waf distclean
+ node-gyp clean
.PHONY: clean distclean test docs docclean
View
49 binding.cc
@@ -35,10 +35,23 @@
#include <set>
#ifdef _WIN32
-#define snprintf _snprintf_s
+# define snprintf _snprintf_s
+ typedef BOOL (WINAPI* SetDllDirectoryFunc)(wchar_t *lpPathName);
+ class SetDllDirectoryCaller {
+ public:
+ explicit SetDllDirectoryCaller() : func_(NULL) { }
+ ~SetDllDirectoryCaller() {
+ if (func_)
+ func_(NULL);
+ }
+ // Sets the SetDllDirectory function pointer to activates this object.
+ void set_func(SetDllDirectoryFunc func) { func_ = func; }
+ private:
+ SetDllDirectoryFunc func_;
+ };
#endif
-#define ZMQ_CAN_DISCONNECT (ZMQ_VERSION_MAJOR == 3 and ZMQ_VERSION_MINOR >= 2) or ZMQ_VERSION_MAJOR > 3
+#define ZMQ_CAN_DISCONNECT (ZMQ_VERSION_MAJOR == 3 && ZMQ_VERSION_MINOR >= 2) || ZMQ_VERSION_MAJOR > 3
using namespace v8;
using namespace node;
@@ -938,11 +951,41 @@ namespace zmq {
}
} // namespace zmq
+
// module
extern "C" void
init(Handle<Object> target) {
+#ifdef _MSC_VER
+ // On Windows, inject the windows/lib folder into the DLL search path so that
+ // it will pick up our bundled DLL in case we do not have zmq installed on
+ // this system.
+ HMODULE kernel32_dll = GetModuleHandleW(L"kernel32.dll");
+ SetDllDirectoryCaller caller;
+ SetDllDirectoryFunc set_dll_directory;
+ wchar_t path[MAX_PATH] = L"";
+ wchar_t pathDir[MAX_PATH] = L"";
+ if (kernel32_dll != NULL) {
+ set_dll_directory =
+ (SetDllDirectoryFunc)GetProcAddress(kernel32_dll, "SetDllDirectoryW");
+ if (set_dll_directory) {
+ GetModuleFileNameW(GetModuleHandleW(L"zmq.node"), path, MAX_PATH - 1);
+ wcsncpy(pathDir, path, wcsrchr(path, '\\') - path);
+ path[0] = '\0';
+ pathDir[wcslen(pathDir)] = '\0';
+# ifdef _WIN64
+ wcscat(pathDir, L"\\..\\..\\windows\\lib\\x64");
+# else
+ wcscat(pathDir, L"\\..\\..\\windows\\lib\\x86");
+# endif
+ _wfullpath(path, pathDir, MAX_PATH);
+ set_dll_directory(path);
+ caller.set_func(set_dll_directory);
+ LoadLibrary("libzmq-v100-mt-3_2_2");
+ }
+ }
+#endif
zmq::Initialize(target);
}
-NODE_MODULE(binding, init)
+NODE_MODULE(zmq, init)
View
33 binding.gyp
@@ -1,12 +1,37 @@
{
'targets': [
{
- 'target_name': 'binding',
+ 'target_name': 'zmq',
'sources': [ 'binding.cc' ],
- 'libraries': ['-lzmq'],
- 'cflags!': ['-fno-exceptions'],
- 'cflags_cc!': ['-fno-exceptions'],
'conditions': [
+ ['OS=="win"', {
+ 'include_dirs': ['windows/include'],
+ 'link_settings': {
+ 'libraries': [
+ 'Delayimp.lib',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'libraries': [
+ '<(PRODUCT_DIR)/../../windows/lib/x86/libzmq-v100-mt-3_2_2.lib',
+ ]
+ },{
+ 'libraries': [
+ '<(PRODUCT_DIR)/../../windows/lib/x64/libzmq-v100-mt-3_2_2.lib',
+ ]
+ }]
+ ],
+ },
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'DelayLoadDLLs': ['libzmq-v100-mt-3_2_2.dll']
+ }
+ },
+ }, {
+ 'libraries': ['-lzmq'],
+ 'cflags!': ['-fno-exceptions'],
+ 'cflags_cc!': ['-fno-exceptions'],
+ }],
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
View
2  lib/index.js
@@ -3,7 +3,7 @@
*/
var EventEmitter = require('events').EventEmitter
- , zmq = require('../build/Release/binding');
+ , zmq = require('../build/Release/zmq');
/**
* Expose bindings as the module.
View
11 package.json
@@ -1,6 +1,6 @@
{
"name": "zmq",
- "version": "2.2.0",
+ "version": "2.3.0",
"description": "Bindings for node.js to zeromq",
"main": "index",
"repository": {
@@ -37,11 +37,14 @@
"Iskren Ivov Chernev <iskren.chernev@gmail.com>",
"Seth Fitzsimmons",
"Patrick Lucas",
- "Alexander Simmerl",
+ "Alexander Simmerl (https://github.com/xla)",
"Ian Babrou",
"Niall O'Higgins",
- "Brian White",
+ "Brian White (https://github.com/mscdex)",
+ "Mathieu D'Amours (https://github.com/matehat)",
"Joshua Gourneau",
- "Yaroslav Shirokov"
+ "Yaroslav Shirokov",
+ "Marc Harter (https://github.com/wavded)",
+ "John Sun (https://github.com/freehaha)"
]
}
View
4 perf/local_thr.js
@@ -25,13 +25,13 @@ sub.on('message', function (data) {
function finish(){
var endtime = process.hrtime(timer)
var millis = (endtime[0]*1000) + (endtime[1]/1000000)
- var throughput = message_count / (millis/1000000)
+ var throughput = message_count / (millis / 1000)
var megabits = (throughput * message_size * 8) / 1000000
console.log('message size: %d [B]', message_size)
console.log('message count: %d', message_count)
console.log('mean throughput: %d [msg/s]', throughput.toFixed(0))
- console.log('mean throughput: %d [Mb/s]', megabits.toFixed(0))
+ console.log('mean throughput: %d [Mbit/s]', megabits.toFixed(0))
console.log('overall time: %d secs and %d nanoseconds', endtime[0], endtime[1])
sub.close()
}
View
6 test/test.exports.js
@@ -57,8 +57,8 @@ if (semver.satisfies(zmq.version, '2.x')) {
]);
}
-// 3.x only.
-if (semver.satisfies(zmq.version, '3.x')) {
+// 3.0 and above.
+if (semver.gte(zmq.version, '3.0.0')) {
constants.concat([
'XPUB',
'XSUB',
@@ -70,7 +70,7 @@ if (semver.satisfies(zmq.version, '3.x')) {
}
// 3.2 and above.
-if (semver.gte('3.2')) {
+if (semver.gte(zmq.version, '3.2.0')) {
constants.concat([
'IPV4ONLY',
'DELAY_ATTACH_ON_CONNECT',
View
402 windows/include/zmq.h
@@ -0,0 +1,402 @@
+/*
+ Copyright (c) 2007-2012 iMatix Corporation
+ Copyright (c) 2009-2011 250bpm s.r.o.
+ Copyright (c) 2011 VMware, Inc.
+ Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ 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
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_H_INCLUDED__
+#define __ZMQ_H_INCLUDED__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined WINCE
+#include <errno.h>
+#endif
+#include <stddef.h>
+#include <stdio.h>
+#if defined _WIN32
+#include <winsock2.h>
+#endif
+
+/* Handle DSO symbol visibility */
+#if defined _WIN32
+# if defined DLL_EXPORT
+# define ZMQ_EXPORT __declspec(dllexport)
+# else
+# define ZMQ_EXPORT __declspec(dllimport)
+# endif
+#else
+# if defined __SUNPRO_C || defined __SUNPRO_CC
+# define ZMQ_EXPORT __global
+# elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
+# define ZMQ_EXPORT __attribute__ ((visibility("default")))
+# else
+# define ZMQ_EXPORT
+# endif
+#endif
+
+/******************************************************************************/
+/* 0MQ versioning support. */
+/******************************************************************************/
+
+/* Version macros for compile-time API version detection */
+#define ZMQ_VERSION_MAJOR 3
+#define ZMQ_VERSION_MINOR 2
+#define ZMQ_VERSION_PATCH 2
+
+#define ZMQ_MAKE_VERSION(major, minor, patch) \
+ ((major) * 10000 + (minor) * 100 + (patch))
+#define ZMQ_VERSION \
+ ZMQ_MAKE_VERSION(ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH)
+
+/* Run-time API version detection */
+ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
+
+/******************************************************************************/
+/* 0MQ errors. */
+/******************************************************************************/
+
+/* A number random enough not to collide with different errno ranges on */
+/* different OSes. The assumption is that error_t is at least 32-bit type. */
+#define ZMQ_HAUSNUMERO 156384712
+
+/* On Windows platform some of the standard POSIX errnos are not defined. */
+#ifndef ENOTSUP
+#define ENOTSUP (ZMQ_HAUSNUMERO + 1)
+#endif
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT (ZMQ_HAUSNUMERO + 2)
+#endif
+#ifndef ENOBUFS
+#define ENOBUFS (ZMQ_HAUSNUMERO + 3)
+#endif
+#ifndef ENETDOWN
+#define ENETDOWN (ZMQ_HAUSNUMERO + 4)
+#endif
+#ifndef EADDRINUSE
+#define EADDRINUSE (ZMQ_HAUSNUMERO + 5)
+#endif
+#ifndef EADDRNOTAVAIL
+#define EADDRNOTAVAIL (ZMQ_HAUSNUMERO + 6)
+#endif
+#ifndef ECONNREFUSED
+#define ECONNREFUSED (ZMQ_HAUSNUMERO + 7)
+#endif
+#ifndef EINPROGRESS
+#define EINPROGRESS (ZMQ_HAUSNUMERO + 8)
+#endif
+#ifndef ENOTSOCK
+#define ENOTSOCK (ZMQ_HAUSNUMERO + 9)
+#endif
+#ifndef EMSGSIZE
+#define EMSGSIZE (ZMQ_HAUSNUMERO + 10)
+#endif
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT (ZMQ_HAUSNUMERO + 11)
+#endif
+#ifndef ENETUNREACH
+#define ENETUNREACH (ZMQ_HAUSNUMERO + 12)
+#endif
+#ifndef ECONNABORTED
+#define ECONNABORTED (ZMQ_HAUSNUMERO + 13)
+#endif
+#ifndef ECONNRESET
+#define ECONNRESET (ZMQ_HAUSNUMERO + 14)
+#endif
+#ifndef ENOTCONN
+#define ENOTCONN (ZMQ_HAUSNUMERO + 15)
+#endif
+#ifndef ETIMEDOUT
+#define ETIMEDOUT (ZMQ_HAUSNUMERO + 16)
+#endif
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH (ZMQ_HAUSNUMERO + 17)
+#endif
+#ifndef ENETRESET
+#define ENETRESET (ZMQ_HAUSNUMERO + 18)
+#endif
+
+/* Native 0MQ error codes. */
+#define EFSM (ZMQ_HAUSNUMERO + 51)
+#define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 52)
+#define ETERM (ZMQ_HAUSNUMERO + 53)
+#define EMTHREAD (ZMQ_HAUSNUMERO + 54)
+
+/* This function retrieves the errno as it is known to 0MQ library. The goal */
+/* of this function is to make the code 100% portable, including where 0MQ */
+/* compiled with certain CRT library (on Windows) is linked to an */
+/* application that uses different CRT library. */
+ZMQ_EXPORT int zmq_errno (void);
+
+/* Resolves system errors and 0MQ errors to human-readable string. */
+ZMQ_EXPORT const char *zmq_strerror (int errnum);
+
+/******************************************************************************/
+/* 0MQ infrastructure (a.k.a. context) initialisation & termination. */
+/******************************************************************************/
+
+/* New API */
+/* Context options */
+#define ZMQ_IO_THREADS 1
+#define ZMQ_MAX_SOCKETS 2
+
+/* Default for new contexts */
+#define ZMQ_IO_THREADS_DFLT 1
+#define ZMQ_MAX_SOCKETS_DFLT 1024
+
+ZMQ_EXPORT void *zmq_ctx_new (void);
+ZMQ_EXPORT int zmq_ctx_destroy (void *context);
+ZMQ_EXPORT int zmq_ctx_set (void *context, int option, int optval);
+ZMQ_EXPORT int zmq_ctx_get (void *context, int option);
+
+/* Old (legacy) API */
+ZMQ_EXPORT void *zmq_init (int io_threads);
+ZMQ_EXPORT int zmq_term (void *context);
+
+
+/******************************************************************************/
+/* 0MQ message definition. */
+/******************************************************************************/
+
+typedef struct zmq_msg_t {unsigned char _ [32];} zmq_msg_t;
+
+typedef void (zmq_free_fn) (void *data, void *hint);
+
+ZMQ_EXPORT int zmq_msg_init (zmq_msg_t *msg);
+ZMQ_EXPORT int zmq_msg_init_size (zmq_msg_t *msg, size_t size);
+ZMQ_EXPORT int zmq_msg_init_data (zmq_msg_t *msg, void *data,
+ size_t size, zmq_free_fn *ffn, void *hint);
+ZMQ_EXPORT int zmq_msg_send (zmq_msg_t *msg, void *s, int flags);
+ZMQ_EXPORT int zmq_msg_recv (zmq_msg_t *msg, void *s, int flags);
+ZMQ_EXPORT int zmq_msg_close (zmq_msg_t *msg);
+ZMQ_EXPORT int zmq_msg_move (zmq_msg_t *dest, zmq_msg_t *src);
+ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src);
+ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg);
+ZMQ_EXPORT size_t zmq_msg_size (zmq_msg_t *msg);
+ZMQ_EXPORT int zmq_msg_more (zmq_msg_t *msg);
+ZMQ_EXPORT int zmq_msg_get (zmq_msg_t *msg, int option);
+ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
+
+
+/******************************************************************************/
+/* 0MQ socket definition. */
+/******************************************************************************/
+
+/* Socket types. */
+#define ZMQ_PAIR 0
+#define ZMQ_PUB 1
+#define ZMQ_SUB 2
+#define ZMQ_REQ 3
+#define ZMQ_REP 4
+#define ZMQ_DEALER 5
+#define ZMQ_ROUTER 6
+#define ZMQ_PULL 7
+#define ZMQ_PUSH 8
+#define ZMQ_XPUB 9
+#define ZMQ_XSUB 10
+
+/* Deprecated aliases */
+#define ZMQ_XREQ ZMQ_DEALER
+#define ZMQ_XREP ZMQ_ROUTER
+
+/* Socket options. */
+#define ZMQ_AFFINITY 4
+#define ZMQ_IDENTITY 5
+#define ZMQ_SUBSCRIBE 6
+#define ZMQ_UNSUBSCRIBE 7
+#define ZMQ_RATE 8
+#define ZMQ_RECOVERY_IVL 9
+#define ZMQ_SNDBUF 11
+#define ZMQ_RCVBUF 12
+#define ZMQ_RCVMORE 13
+#define ZMQ_FD 14
+#define ZMQ_EVENTS 15
+#define ZMQ_TYPE 16
+#define ZMQ_LINGER 17
+#define ZMQ_RECONNECT_IVL 18
+#define ZMQ_BACKLOG 19
+#define ZMQ_RECONNECT_IVL_MAX 21
+#define ZMQ_MAXMSGSIZE 22
+#define ZMQ_SNDHWM 23
+#define ZMQ_RCVHWM 24
+#define ZMQ_MULTICAST_HOPS 25
+#define ZMQ_RCVTIMEO 27
+#define ZMQ_SNDTIMEO 28
+#define ZMQ_IPV4ONLY 31
+#define ZMQ_LAST_ENDPOINT 32
+#define ZMQ_ROUTER_MANDATORY 33
+#define ZMQ_TCP_KEEPALIVE 34
+#define ZMQ_TCP_KEEPALIVE_CNT 35
+#define ZMQ_TCP_KEEPALIVE_IDLE 36
+#define ZMQ_TCP_KEEPALIVE_INTVL 37
+#define ZMQ_TCP_ACCEPT_FILTER 38
+#define ZMQ_DELAY_ATTACH_ON_CONNECT 39
+#define ZMQ_XPUB_VERBOSE 40
+
+
+/* Message options */
+#define ZMQ_MORE 1
+
+/* Send/recv options. */
+#define ZMQ_DONTWAIT 1
+#define ZMQ_SNDMORE 2
+
+/* Deprecated aliases */
+#define ZMQ_NOBLOCK ZMQ_DONTWAIT
+#define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY
+#define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY
+
+/******************************************************************************/
+/* 0MQ socket events and monitoring */
+/******************************************************************************/
+
+/* Socket transport events (tcp and ipc only) */
+#define ZMQ_EVENT_CONNECTED 1
+#define ZMQ_EVENT_CONNECT_DELAYED 2
+#define ZMQ_EVENT_CONNECT_RETRIED 4
+
+#define ZMQ_EVENT_LISTENING 8
+#define ZMQ_EVENT_BIND_FAILED 16
+
+#define ZMQ_EVENT_ACCEPTED 32
+#define ZMQ_EVENT_ACCEPT_FAILED 64
+
+#define ZMQ_EVENT_CLOSED 128
+#define ZMQ_EVENT_CLOSE_FAILED 256
+#define ZMQ_EVENT_DISCONNECTED 512
+
+#define ZMQ_EVENT_ALL ( ZMQ_EVENT_CONNECTED | ZMQ_EVENT_CONNECT_DELAYED | \
+ ZMQ_EVENT_CONNECT_RETRIED | ZMQ_EVENT_LISTENING | \
+ ZMQ_EVENT_BIND_FAILED | ZMQ_EVENT_ACCEPTED | \
+ ZMQ_EVENT_ACCEPT_FAILED | ZMQ_EVENT_CLOSED | \
+ ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED )
+
+/* Socket event data (union member per event) */
+typedef struct {
+ int event;
+ union {
+ struct {
+ char *addr;
+ int fd;
+ } connected;
+ struct {
+ char *addr;
+ int err;
+ } connect_delayed;
+ struct {
+ char *addr;
+ int interval;
+ } connect_retried;
+ struct {
+ char *addr;
+ int fd;
+ } listening;
+ struct {
+ char *addr;
+ int err;
+ } bind_failed;
+ struct {
+ char *addr;
+ int fd;
+ } accepted;
+ struct {
+ char *addr;
+ int err;
+ } accept_failed;
+ struct {
+ char *addr;
+ int fd;
+ } closed;
+ struct {
+ char *addr;
+ int err;
+ } close_failed;
+ struct {
+ char *addr;
+ int fd;
+ } disconnected;
+ } data;
+} zmq_event_t;
+
+ZMQ_EXPORT void *zmq_socket (void *, int type);
+ZMQ_EXPORT int zmq_close (void *s);
+ZMQ_EXPORT int zmq_setsockopt (void *s, int option, const void *optval,
+ size_t optvallen);
+ZMQ_EXPORT int zmq_getsockopt (void *s, int option, void *optval,
+ size_t *optvallen);
+ZMQ_EXPORT int zmq_bind (void *s, const char *addr);
+ZMQ_EXPORT int zmq_connect (void *s, const char *addr);
+ZMQ_EXPORT int zmq_unbind (void *s, const char *addr);
+ZMQ_EXPORT int zmq_disconnect (void *s, const char *addr);
+ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags);
+ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
+ZMQ_EXPORT int zmq_socket_monitor (void *s, const char *addr, int events);
+
+ZMQ_EXPORT int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags);
+ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags);
+
+/* Experimental */
+struct iovec;
+
+ZMQ_EXPORT int zmq_sendiov (void *s, struct iovec *iov, size_t count, int flags);
+ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov, size_t *count, int flags);
+
+/******************************************************************************/
+/* I/O multiplexing. */
+/******************************************************************************/
+
+#define ZMQ_POLLIN 1
+#define ZMQ_POLLOUT 2
+#define ZMQ_POLLERR 4
+
+typedef struct
+{
+ void *socket;
+#if defined _WIN32
+ SOCKET fd;
+#else
+ int fd;
+#endif
+ short events;
+ short revents;
+} zmq_pollitem_t;
+
+ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
+
+// Built-in message proxy (3-way)
+
+ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture);
+
+// Deprecated aliases
+#define ZMQ_STREAMER 1
+#define ZMQ_FORWARDER 2
+#define ZMQ_QUEUE 3
+// Deprecated method
+ZMQ_EXPORT int zmq_device (int type, void *frontend, void *backend);
+
+#undef ZMQ_EXPORT
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
View
64 windows/include/zmq_utils.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2009-2011 250bpm s.r.o.
+ Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
+
+ This file is part of 0MQ.
+
+ 0MQ is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ 0MQ 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
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __ZMQ_UTILS_H_INCLUDED__
+#define __ZMQ_UTILS_H_INCLUDED__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Handle DSO symbol visibility */
+#if defined _WIN32
+# if defined DLL_EXPORT
+# define ZMQ_EXPORT __declspec(dllexport)
+# else
+# define ZMQ_EXPORT __declspec(dllimport)
+# endif
+#else
+# if defined __SUNPRO_C || defined __SUNPRO_CC
+# define ZMQ_EXPORT __global
+# elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER
+# define ZMQ_EXPORT __attribute__ ((visibility("default")))
+# else
+# define ZMQ_EXPORT
+# endif
+#endif
+
+/* Helper functions are used by perf tests so that they don't have to care */
+/* about minutiae of time-related functions on different OS platforms. */
+
+/* Starts the stopwatch. Returns the handle to the watch. */
+ZMQ_EXPORT void *zmq_stopwatch_start (void);
+
+/* Stops the stopwatch. Returns the number of microseconds elapsed since */
+/* the stopwatch was started. */
+ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_);
+
+/* Sleeps for specified number of seconds. */
+ZMQ_EXPORT void zmq_sleep (int seconds_);
+
+#undef ZMQ_EXPORT
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
View
BIN  windows/lib/x64/libzmq-v100-mt-3_2_2.dll
Binary file not shown
View
BIN  windows/lib/x64/libzmq-v100-mt-3_2_2.lib
Binary file not shown
View
BIN  windows/lib/x86/libzmq-v100-mt-3_2_2.dll
Binary file not shown
View
BIN  windows/lib/x86/libzmq-v100-mt-3_2_2.lib
Binary file not shown
View
36 wscript
@@ -1,36 +0,0 @@
-import Options
-from os import unlink, link
-from os.path import exists
-
-APPNAME = 'zeromq.node'
-VERSION = "1.0.0"
-
-def set_options(opt):
- opt.tool_options("compiler_cxx")
-
-def configure(conf):
- conf.check_tool("compiler_cxx")
- conf.check_tool("node_addon")
- conf.check_cfg(atleast_pkgconfig_version='0.0.0', mandatory=True, errmsg='pkg-config was not found')
- conf.check_cfg(package='libzmq', atleast_version='2.1.0', uselib_store='ZMQ', args='--cflags --libs', mandatory=True, errmsg='Package libzmq was not found')
- conf.check(lib='uuid', uselib_store='UUID')
-
-def build(bld):
- obj = bld.new_task_gen("cxx", "shlib", "node_addon")
- obj.target = "binding"
- obj.source = "binding.cc"
- obj.uselib = "ZMQ UUID"
-
-def shutdown():
- # HACK to get binding.node out of build directory.
- # better way to do this?
- if exists('./binding.node'):
- unlink('./binding.node')
- if Options.commands['build']:
- if exists('./build/default/binding.node'):
- link('./build/default/binding.node', './binding.node')
- elif exists('./build/Release/binding.node'):
- link('./build/Release/binding.node', './binding.node')
- else:
- raise Exception("Cannot locate build binding.node")
-

0 comments on commit 252fb20

Please sign in to comment.
Something went wrong with that request. Please try again.