diff options
author | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-09 09:24:48 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@fastmq.commkdir> | 2009-08-09 09:24:48 +0200 |
commit | 5b5b513330e96e3e08d0c2c60d03044091976420 (patch) | |
tree | 1eb97606ff6827760c0b063aca95470df6ae20a1 /include/zmq.h | |
parent | a8b410e66c3c75809c8e9c01dd3e35c579f02347 (diff) |
socket options interface modeled as in BSD sockets
Diffstat (limited to 'include/zmq.h')
-rw-r--r-- | include/zmq.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/zmq.h b/include/zmq.h index 0fbc142..63c8434 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -42,6 +42,14 @@ extern "C" { #define ZMQ_DELIMITER 31 #define ZMQ_VSM 32 +// Socket options. +#define ZMQ_HWM 1 +#define ZMQ_LWM 2 +#define ZMQ_SWAP 3 +#define ZMQ_MASK 4 +#define ZMQ_AFFINITY 5 +#define ZMQ_SESSIONID 6 + // The operation should be performed in non-blocking mode. I.e. if it cannot // be processed immediately, error should be returned with errno set to EAGAIN. #define ZMQ_NOBLOCK 1 @@ -94,18 +102,6 @@ struct zmq_msg unsigned char vsm_data [ZMQ_MAX_VSM_SIZE]; }; -// TODO: Different options... -struct zmq_opts -{ - uint64_t hwm; - uint64_t lwm; - uint64_t swap; - uint64_t mask; - uint64_t taskset; - const char *identity; - const char *args; -}; - // Initialise an empty message (zero bytes long). ZMQ_EXPORT int zmq_msg_init (zmq_msg *msg); @@ -165,11 +161,15 @@ ZMQ_EXPORT void *zmq_socket (void *context, int type); // Close the socket. ZMQ_EXPORT int zmq_close (void *s); +// Sets an option on the socket. +ZMQ_EXPORT int zmq_setsockopt (void *s, int option_, void *optval_, + size_t optvallen_); + // Bind the socket to a particular address. -ZMQ_EXPORT int zmq_bind (void *s, const char *addr, zmq_opts *opts); +ZMQ_EXPORT int zmq_bind (void *s, const char *addr); // Connect the socket to a particular address. -ZMQ_EXPORT int zmq_connect (void *s, const char *addr, zmq_opts *opts); +ZMQ_EXPORT int zmq_connect (void *s, const char *addr); // Subscribe for the subset of messages identified by 'criteria' argument. ZMQ_EXPORT int zmq_subscribe (void *s, const char *criteria); |