ZMQContext::getSocket

Description

Shortcut for creating new sockets from the context. If the context is not persistent the persistent_id
parameter is ignored and the socket falls back to being non-persistent. The on_new_socket is called only
when a new underlying socket structure is created.

Parameters

type

ZMQ::SOCKET_* constant to specify socket type.

persistent_id

If persistent_id is specified the socket will be persisted over multiple requests.

on_new_socket

Callback function, which is executed when a new socket structure is created. This function does not get invoked
if the underlying persistent connection is re-used. The callback takes ZMQSocket and persistent_id as two arguments.