Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zyre binding #133

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c79c471
Add ZMQZyre class, a binding of the libzyre
wysman Jul 2, 2014
e3ad68f
Update api.h
wysman Jul 2, 2014
b18fec2
Add test on ZMQZyre::getSocket
wysman Jul 2, 2014
b35155c
Refactor ZMQZyre::getSocket
wysman Jul 3, 2014
994f3ca
Display version of libs
wysman Jul 3, 2014
929b108
Remove a camelcase variable
wysman Jul 3, 2014
f0ccd4f
Use real tabs
wysman Jul 3, 2014
7bd6f6c
add zend_parse_parameters_none where missing
wysman Jul 3, 2014
574d4a0
Fix returns after zend_parse_parameters
wysman Jul 3, 2014
fa37d9b
Use PHP_ZMQ_ZYRE_OBJECT to create this pointer
wysman Jul 3, 2014
0027747
Ensure peer or groupe name are not empty
wysman Jul 3, 2014
cfabf10
Check for null pointers
wysman Jul 3, 2014
5d74206
Set persistent_id to NULL
wysman Jul 3, 2014
64d6cd1
Add test of using ZMQPoll with ZMQZyre
wysman Jul 3, 2014
c4be910
Add zyre tests file in the package.xml
wysman Jul 3, 2014
7a2297f
Use correct filename... need a break ;)
wysman Jul 3, 2014
05c5c8d
Throw exception, if group name or peer id are empty
wysman Jul 8, 2014
89a3911
ecalloc, do not need null check
wysman Jul 8, 2014
0955820
Fix memory leak
wysman Jul 8, 2014
40ed1b5
Use zsys_version to find libczmq version at execution
wysman Jul 16, 2014
2d5e18c
Add gitignore
wysman Jul 16, 2014
46e7b8f
Merge remote-tracking branch 'origin/master' into zyre
wysman Jul 16, 2014
db12454
Display the CZMQ & Zyre librairy version, only if detected by configu…
wysman Jul 16, 2014
2c2e564
Fix build if zyre is not available
wysman Jul 17, 2014
104e908
Add install from bianary repo of czmq & zyre
wysman Jul 22, 2014
bb5f512
Reduce travis test matrix for test, will be revert
wysman Jul 22, 2014
b087ddb
be verbose on link creation for travis log
wysman Jul 22, 2014
0ec9791
configure PKG_CONFIG_PATH in travis bootstrap
wysman Jul 22, 2014
c4b9fc2
typo
wysman Jul 22, 2014
05f8a3f
Try direct export, configure script do not detect czmq/zyre
wysman Jul 22, 2014
1f220e1
add debugs
wysman Jul 22, 2014
cfcc299
Test autodetection of libzmq in configure script
wysman Jul 22, 2014
1a18827
Ensure the php extension build is OK, before running test
wysman Jul 22, 2014
6a96e40
Pass TSRMLS_C into zhash_foreach callback
wysman Jul 22, 2014
45190b8
Remove pre-installed version of zmq by travis
wysman Jul 22, 2014
c99745f
Be more verbose on pkg-config
wysman Jul 22, 2014
141ff43
Restore with-zmq option on configure
wysman Jul 23, 2014
af91e6a
Test build from source for czmq/zyre ibs with the same prefix as zmq …
wysman Jul 23, 2014
3ecd031
typo
wysman Jul 23, 2014
ae15fc2
typo
wysman Oct 8, 2014
0cf5fbb
Merge branch 'master' into zyre
wysman Oct 13, 2014
6ce250f
Reduce tests matrix, will be revert
wysman Oct 13, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test on ZMQZyre::getSocket
wysman committed Jul 2, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b18fec2c7c4ef235122fb48002ebdfd6dd14c85f
3 changes: 3 additions & 0 deletions tests/zyre-002.phpt
Original file line number Diff line number Diff line change
@@ -27,8 +27,11 @@ var_dump($obj->headers->{'X-TEST'});

$z1->stop();

usleep(100000);

$obj = $z2->recv();
var_dump($obj->command);

$z2->stop();

--EXPECTF--
41 changes: 41 additions & 0 deletions tests/zyre-005.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--TEST--
Test [Zyre] Test getter of internal ZMQSocket in ZMQZyre
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipzyre.inc'); ?>
--FILE--
<?php

$ctx = new ZMQContext;

$z1 = new ZMQZyre($ctx);
$z1->setHeader('X-TEST', 'Z1');
$z1->start();

usleep(100000);

$z2 = new ZMQZyre($ctx);
$z2->setHeader('X-TEST', 'Z2');
$z2->start();

usleep(100000);

$sock1 = $z1->getSocket();
$sock2 = $z2->getSocket();


var_dump($sock1->recv()); // Enter
$sock1->recv(); // ID
$sock1->recv(); // Headers
$sock1->recv(); // IP:PORT

var_dump($sock2->recv()); // Enter
$sock2->recv(); // ID
$sock2->recv(); // Headers
$sock2->recv(); // IP:PORT

unset($sock1);
unset($sock2);

--EXPECTF--
string(5) "ENTER"
string(5) "ENTER"
2 changes: 1 addition & 1 deletion zmq.c
Original file line number Diff line number Diff line change
@@ -1951,7 +1951,7 @@ PHP_METHOD(zmqzyre, getSocket)
// Create internal socket
php_zmq_socket *socket = (php_zmq_socket *) emalloc(sizeof(php_zmq_socket));
socket->z_socket = zyre_sock;
socket->ctx = NULL;
socket->ctx = this->shadow_context;
socket->pid = getpid();
socket->is_persistent = is_persistent;
zend_hash_init(&(socket->connect), 0, NULL, NULL, is_persistent);