Skip to content

Commit

Permalink
Problem: out of sync with zproject
Browse files Browse the repository at this point in the history
  • Loading branch information
wesyoung committed Aug 2, 2017
1 parent 770a496 commit 038ac4f
Show file tree
Hide file tree
Showing 50 changed files with 1,617 additions and 1,421 deletions.
25 changes: 24 additions & 1 deletion CMakeLists.txt
Expand Up @@ -178,7 +178,10 @@ set_target_properties(zyre
PROPERTIES DEFINE_SYMBOL "ZYRE_EXPORTS"
)
set_target_properties (zyre
PROPERTIES SOVERSION "2.0.1"
PROPERTIES SOVERSION "2"
)
set_target_properties (zyre
PROPERTIES VERSION "2.0.1"
)
target_link_libraries(zyre
${ZEROMQ_LIBRARIES} ${MORE_LIBRARIES}
Expand Down Expand Up @@ -312,6 +315,22 @@ IF (ENABLE_DRAFTS)
)
ENDIF (ENABLE_DRAFTS)


add_custom_target(
copy-selftest-ro ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/src/selftest-ro ${CMAKE_BINARY_DIR}/src/selftest-ro
)

add_custom_target(
make-selftest-rw ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/src/selftest-rw
)

set_directory_properties(
PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_BINARY_DIR}/src/selftest-ro;${CMAKE_BINARY_DIR}/src/selftest-rw"
)

foreach(TEST_CLASS ${TEST_CLASSES})
add_test(
NAME ${TEST_CLASS}
Expand All @@ -321,6 +340,10 @@ foreach(TEST_CLASS ${TEST_CLASSES})
${TEST_CLASS}
PROPERTIES TIMEOUT ${CLASSTEST_TIMEOUT}
)
set_tests_properties(
${TEST_CLASS}
PROPERTIES DEPENDS "copy-selftest-ro;make-selftest-rw"
)
endforeach(TEST_CLASS)

include(CTest)
Expand Down
3 changes: 1 addition & 2 deletions Vagrantfile
Expand Up @@ -4,7 +4,6 @@
# This will setup a clean Ubuntu1404 LTS env

$script = <<SCRIPT
add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt-get update
apt-get install -y python-pip python-dev git htop virtualenvwrapper python2.7 python-virtualenv python-support cython \
git build-essential libtool pkg-config autotools-dev autoconf automake cmake uuid-dev libpcre3-dev valgrind \
Expand Down Expand Up @@ -49,7 +48,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", inline: $script

config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "512" ]
vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "1024" ]
end

if File.file?(VAGRANTFILE_LOCAL)
Expand Down
72 changes: 36 additions & 36 deletions bindings/jni/src/main/java/org/zeromq/zyre/Zyre.java
Expand Up @@ -19,9 +19,9 @@ public class Zyre implements AutoCloseable{
public long self;
/*
Constructor, creates a new Zyre node. Note that until you start the
node it is silent and invisible to other nodes on the network.
The node name is provided to other nodes during discovery. If you
specify NULL, Zyre generates a randomized node name from the UUID.
node it is silent and invisible to other nodes on the network.
The node name is provided to other nodes during discovery. If you
specify NULL, Zyre generates a randomized node name from the UUID.
*/
native static long __new (String name);
public Zyre (String name) {
Expand All @@ -33,7 +33,7 @@ public Zyre (long pointer) {
}
/*
Destructor, destroys a Zyre node. When you destroy a node, any
messages it is sending or receiving will be discarded.
messages it is sending or receiving will be discarded.
*/
native static void __destroy (long self);
@Override
Expand All @@ -50,31 +50,31 @@ public String uuid () {
}
/*
Return our node name, after successful initialization. First 6
characters of UUID by default.
characters of UUID by default.
*/
native static String __name (long self);
public String name () {
return __name (self);
}
/*
Set the public name of this node overriding the default. The name is
provide during discovery and come in each ENTER message.
provide during discovery and come in each ENTER message.
*/
native static void __setName (long self, String name);
public void setName (String name) {
__setName (self, name);
}
/*
Set node header; these are provided to other nodes during discovery
and come in each ENTER message.
and come in each ENTER message.
*/
native static void __setHeader (long self, String name, String format);
public void setHeader (String name, String format) {
__setHeader (self, name, format);
}
/*
Set verbose mode; this tells the node to log all traffic as well as
all major events.
all major events.
*/
native static void __setVerbose (long self);
public void setVerbose () {
Expand All @@ -83,7 +83,7 @@ public void setVerbose () {
/*
Set UDP beacon discovery port; defaults to 5670, this call overrides
that so you can create independent clusters on the same network, for
e.g. development vs. production. Has no effect after zyre_start().
e.g. development vs. production. Has no effect after zyre_start().
*/
native static void __setPort (long self, int portNbr);
public void setPort (int portNbr) {
Expand All @@ -92,8 +92,8 @@ public void setPort (int portNbr) {
/*
Set the peer evasiveness timeout, in milliseconds. Default is 5000.
This can be tuned in order to deal with expected network conditions
and the response time expected by the application. This is tied to
the beacon interval and rate of messages received.
and the response time expected by the application. This is tied to
the beacon interval and rate of messages received.
*/
native static void __setEvasiveTimeout (long self, int interval);
public void setEvasiveTimeout (int interval) {
Expand All @@ -102,16 +102,16 @@ public void setEvasiveTimeout (int interval) {
/*
Set the peer expiration timeout, in milliseconds. Default is 30000.
This can be tuned in order to deal with expected network conditions
and the response time expected by the application. This is tied to
the beacon interval and rate of messages received.
and the response time expected by the application. This is tied to
the beacon interval and rate of messages received.
*/
native static void __setExpiredTimeout (long self, int interval);
public void setExpiredTimeout (int interval) {
__setExpiredTimeout (self, interval);
}
/*
Set UDP beacon discovery interval, in milliseconds. Default is instant
beacon exploration followed by pinging every 1,000 msecs.
beacon exploration followed by pinging every 1,000 msecs.
*/
native static void __setInterval (long self, long interval);
public void setInterval (long interval) {
Expand All @@ -120,21 +120,21 @@ public void setInterval (long interval) {
/*
Set network interface for UDP beacons. If you do not set this, CZMQ will
choose an interface for you. On boxes with several interfaces you should
specify which one you want to use, or strange things can happen.
specify which one you want to use, or strange things can happen.
*/
native static void __setInterface (long self, String value);
public void setInterface (String value) {
__setInterface (self, value);
}
/*
By default, Zyre binds to an ephemeral TCP port and broadcasts the local
host name using UDP beaconing. When you call this method, Zyre will use
gossip discovery instead of UDP beaconing. You MUST set-up the gossip
By default, Zyre binds to an ephemeral TCP port and broadcasts the local
host name using UDP beaconing. When you call this method, Zyre will use
gossip discovery instead of UDP beaconing. You MUST set-up the gossip
service separately using zyre_gossip_bind() and _connect(). Note that the
endpoint MUST be valid for both bind and connect operations. You can use
inproc://, ipc://, or tcp:// transports (for tcp://, use an IP address
that is meaningful to remote as well as local nodes). Returns 0 if
the bind was successful, else -1.
endpoint MUST be valid for both bind and connect operations. You can use
inproc://, ipc://, or tcp:// transports (for tcp://, use an IP address
that is meaningful to remote as well as local nodes). Returns 0 if
the bind was successful, else -1.
*/
native static int __setEndpoint (long self, String format);
public int setEndpoint (String format) {
Expand All @@ -143,17 +143,17 @@ public int setEndpoint (String format) {
/*
Set-up gossip discovery of other nodes. At least one node in the cluster
must bind to a well-known gossip endpoint, so other nodes can connect to
it. Note that gossip endpoints are completely distinct from Zyre node
endpoints, and should not overlap (they can use the same transport).
it. Note that gossip endpoints are completely distinct from Zyre node
endpoints, and should not overlap (they can use the same transport).
*/
native static void __gossipBind (long self, String format);
public void gossipBind (String format) {
__gossipBind (self, format);
}
/*
Set-up gossip discovery of other nodes. A node may connect to multiple
other nodes, for redundancy paths. For details of the gossip network
design, see the CZMQ zgossip class.
other nodes, for redundancy paths. For details of the gossip network
design, see the CZMQ zgossip class.
*/
native static void __gossipConnect (long self, String format);
public void gossipConnect (String format) {
Expand All @@ -162,24 +162,24 @@ public void gossipConnect (String format) {
/*
Start node, after setting header values. When you start a node it
begins discovery and connection. Returns 0 if OK, -1 if it wasn't
possible to start the node.
possible to start the node.
*/
native static int __start (long self);
public int start () {
return __start (self);
}
/*
Stop node; this signals to other peers that this node will go away.
This is polite; however you can also just destroy the node without
stopping it.
This is polite; however you can also just destroy the node without
stopping it.
*/
native static void __stop (long self);
public void stop () {
__stop (self);
}
/*
Join a named group; after joining a group you can send messages to
the group and all Zyre nodes in that group will receive them.
the group and all Zyre nodes in that group will receive them.
*/
native static int __join (long self, String group);
public int join (String group) {
Expand All @@ -194,23 +194,23 @@ public int leave (String group) {
}
/*
Receive next message from network; the message may be a control
message (ENTER, EXIT, JOIN, LEAVE) or data (WHISPER, SHOUT).
Returns zmsg_t object, or NULL if interrupted
message (ENTER, EXIT, JOIN, LEAVE) or data (WHISPER, SHOUT).
Returns zmsg_t object, or NULL if interrupted
*/
native static long __recv (long self);
public Zmsg recv () {
return new Zmsg (__recv (self));
}
/*
Send message to single peer, specified as a UUID string
Destroys message after sending
Destroys message after sending
*/
native static int __whisper (long self, String peer, long msgP);
public int whisper (String peer, Zmsg msgP) {
return __whisper (self, peer, msgP.self);
}
/*
Send message to a named group
Send message to a named group
Destroys message after sending
*/
native static int __shout (long self, String group, long msgP);
Expand Down Expand Up @@ -268,7 +268,7 @@ public String peerAddress (String peer) {
}
/*
Return the value of a header of a conected peer.
Returns null if peer or key doesn't exits.
Returns null if peer or key doesn't exits.
*/
native static String __peerHeaderValue (long self, String peer, String name);
public String peerHeaderValue (String peer, String name) {
Expand All @@ -290,7 +290,7 @@ public void print () {
}
/*
Return the Zyre version for run-time API detection; returns
major * 10000 + minor * 100 + patch, as a single integer.
major * 10000 + minor * 100 + patch, as a single integer.
*/
native static long __version ();
public long version () {
Expand Down
16 changes: 8 additions & 8 deletions bindings/jni/src/main/java/org/zeromq/zyre/ZyreEvent.java
Expand Up @@ -19,8 +19,8 @@ public class ZyreEvent implements AutoCloseable{
public long self;
/*
Constructor: receive an event from the zyre node, wraps zyre_recv.
The event may be a control message (ENTER, EXIT, JOIN, LEAVE) or
data (WHISPER, SHOUT).
The event may be a control message (ENTER, EXIT, JOIN, LEAVE) or
data (WHISPER, SHOUT).
*/
native static long __new (long node);
public ZyreEvent (Zyre node) {
Expand All @@ -40,9 +40,9 @@ public void close () {
self = 0;
}
/*
Returns event type, as printable uppercase string. Choices are:
Returns event type, as printable uppercase string. Choices are:
"ENTER", "EXIT", "JOIN", "LEAVE", "EVASIVE", "WHISPER" and "SHOUT"
and for the local node: "STOP"
and for the local node: "STOP"
*/
native static String __type (long self);
public String type () {
Expand Down Expand Up @@ -77,7 +77,7 @@ public Zhash headers () {
return new Zhash (__headers (self));
}
/*
Returns value of a header from the message headers
Returns value of a header from the message headers
obtained by ENTER. Return NULL if no value was found.
*/
native static String __header (long self, String name);
Expand All @@ -93,16 +93,16 @@ public String group () {
}
/*
Returns the incoming message payload; the caller can modify the
message but does not own it and should not destroy it.
message but does not own it and should not destroy it.
*/
native static long __msg (long self);
public Zmsg msg () {
return new Zmsg (__msg (self));
}
/*
Returns the incoming message payload, and pass ownership to the
Returns the incoming message payload, and pass ownership to the
caller. The caller must destroy the message when finished with it.
After called on the given event, further calls will return NULL.
After called on the given event, further calls will return NULL.
*/
native static long __getMsg (long self);
public Zmsg getMsg () {
Expand Down

0 comments on commit 038ac4f

Please sign in to comment.