zeromq / zbroker

Elastic pipes
Mozilla Public License 2.0
50 stars 11 forks source link

Problem: libzmtp stack does not connect #69

Closed hintjens closed 10 years ago

hintjens commented 10 years ago

In https://github.com/hintjens/zbroker/commit/6d8a1060787c2e07d77664b1574aab5ebcde2d2a I pushed a new client stack for zpipes, which uses libzmtp.

The selftest fails in clients/zpipes_client.c:72:

int rc = zmtp_dealer_ipc_connect (self->dealer, endpoint);
assert (rc == 0);
hurtonm commented 10 years ago

I run "make check" and git the following error: lt-zbroker_selftest: zpipes_server_engine.h:1565: s_server_control_message: Assertion `self->port != -1' failed. /bin/bash: line 5: 21180 Aborted ${dir}$tst FAIL: zbroker_selftest

Any idea why?

hintjens commented 10 years ago

It's doing a socket bind that's failing. You can print out the endpoint, may be something on your box?

On Tue, May 6, 2014 at 9:00 AM, Martin Hurton notifications@github.comwrote:

I run "make check" and git the following error: lt-zbroker_selftest: zpipes_server_engine.h:1565: s_server_control_message: Assertion `self->port != -1' failed. /bin/bash: line 5: 21180 Aborted ${dir}$tst FAIL: zbroker_selftest

Any idea why?

— Reply to this email directly or view it on GitHubhttps://github.com/zeromq/zbroker/issues/69#issuecomment-42272750 .

hurtonm commented 10 years ago

zmtp_dealer_ipc_connect () fails because there is no one listening on specified endpoint. Please note that libzmtp does not support reconnection so when you created listener after you try to connect, the connect will fail. I may implement reconnect functionality in libzmtp if necessary.

hintjens commented 10 years ago

Ah, okay... that helps. Thanks On May 7, 2014 7:46 AM, "Martin Hurton" notifications@github.com wrote:

zmtp_dealer_ipc_connect () fails because there is no one listening on specified endpoint. Please note that libzmtp does not support reconnection so when you created listener after you try to connect, the connect will fail. I may implement reconnect functionality in libzmtp if necessary.

— Reply to this email directly or view it on GitHubhttps://github.com/zeromq/zbroker/issues/69#issuecomment-42391664 .

hintjens commented 10 years ago

Have you implemented abstract IPC endpoints? Perhaps this is the problem, since I do start the broker before the client test. The connection is like this:

snprintf (endpoint, 255, "ipc://@/zpipes/%s", server_name);
endpoint [255] = 0;
int rc = zmtp_dealer_ipc_connect (self->dealer, endpoint);
assert (rc == 0);

The syntax of abstract IPC endpoints comes from libzmq and it's useful because it doesn't create files. I'll test with classic IPC endpoints anyhow.

hintjens commented 10 years ago

OK, I've got the connection working. It doesn't accept a 'standard' endpoint, i.e. with "ipc://", rather it expects a pathname.