oxen-mq/oxenmq
Jason Rhinelander edcde9246a
Fix zmq socket limit setting
MAX_SOCKETS wasn't working properly because ZMQ uses it when the context
is initialized, which happens when the first socket is constructed on
that context.

For OxenMQ, we had several sockets constructed on the context during
OxenMQ construction, which meant the context_t was being initialized
during OxenMQ construction, rather than during start(), and so setting
MAX_SOCKETS would have no effect and you'd always get the default.

This fixes it by making all the member variable zmq::socket_t's
default-constructed, then replacing them with proper zmq::socket_t's
during startup() so that we also defer zmq::context_t initialization to
the right place.

A second issue found during testing (also fixed here) is that the socket
worker threads use to communicate to the proxy could fail if the worker
socket creation would violate the zmq max sockets limit, which wound up
throwing an uncaught exception and aborting.  This pre-initializes (but
doesn't connect) all potential worker threads sockets during start() so
that the lazily-initialized worker thread will have one already set up
rather than having to create a new one (which could fail).
2022-08-05 10:40:01 -03:00
..
address.cpp Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
address.h Add std::hash implementation for oxenmq::address 2021-11-28 10:26:35 -04:00
auth.cpp Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
auth.h adds custom formatter for OMQ structs that have to_string member 2022-08-04 10:50:02 +10:00
base32z.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
base64.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
batch.h Add simpler Job subclass of Batch for simple jobs 2022-05-12 12:20:51 -03:00
bt_producer.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
bt_serialize.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
bt_value.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
connections.cpp Fix zmq socket limit setting 2022-08-05 10:40:01 -03:00
connections.h adds custom formatter for OMQ structs that have to_string member 2022-08-04 10:50:02 +10:00
fmt.h adds custom formatter for OMQ structs that have to_string member 2022-08-04 10:50:02 +10:00
hex.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
jobs.cpp Use raw index bytes in worker router 2022-05-12 12:38:13 -03:00
message.h Rebrand variables LMQ -> OMQ 2021-11-30 14:10:47 -04:00
oxenmq-internal.h adds custom formatter for OMQ structs that have to_string member 2022-08-04 10:50:02 +10:00
oxenmq.cpp Fix zmq socket limit setting 2022-08-05 10:40:01 -03:00
oxenmq.h Fix zmq socket limit setting 2022-08-05 10:40:01 -03:00
proxy.cpp Fix zmq socket limit setting 2022-08-05 10:40:01 -03:00
variant.h Use oxen-encoding and add compatibility shim headers 2022-01-18 10:30:23 -04:00
version.h.in Bump (and cmake-modernize) version 2021-04-15 15:15:44 -03:00
worker.cpp Fix zmq socket limit setting 2022-08-05 10:40:01 -03:00