Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ZMQDevice::__construct() expects exactly 2 parameters, 3 given #43

Closed
markkimsal opened this Issue · 6 comments

4 participants

@markkimsal

Running the PHP example "msgqueue.php" from the zguide repo results in a warning and a segfault.

PHP Warning: ZMQDevice::__construct() expects exactly 2 parameters, 3 given in ./zguide/examples/PHP/msgqueue.php on line 20
Segmentation fault

Not sure why ZMQDevice::__construct() expects only 2 parameters. It doesn't look that way looking at zmq.c, not sure how to suggest a fix.

@mkoppanen
Owner

Hi,

please take a look at the ChangeLog for 1.x version:

"the constructor now takes two arguments, front
and back socket. Starting the device has been moved to separate run method and
two new methods setIdleTimeout and setIdleCallback has been added."

Most likely the examples have not been updated yet. I think updating the guide is on Ian's todo list

@mkoppanen mkoppanen closed this
@markkimsal

Seems like the function prototype documentation claims 3 params (type, frontend, backend).

/* {{{ proto void ZMQDevice::__construct(int type, ZMQSocket frontend, ZMQSocket backend)
Construct a device
*/

Is the type planned to be supported or was it supported and is being taken out?

@mkoppanen
Owner

It was supported but was taken out. The prototype should be fixed now.

@ithinkihaveacat

@ianbarber Any chance of fixing the http://zguide.zeromq.org/php:msgqueue example? So there's no way to create a FORWARDER or STREAMER device--you always get a QUEUE?

@mkoppanen
Owner

As mentioned in another issue these devices were identical. The parameter was really redundant.

@ianbarber

Yeah, I'll fix the example in the guide to reflect.

@mkoppanen mkoppanen referenced this issue from a commit
@mkoppanen Added test for #43 516bd6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.