Commit Graph

110 Commits

Author SHA1 Message Date
Pieter Hintjens
3ee99ae81f Renamed scatter/gather methods, cleaned up source 2012-02-16 12:30:37 -06:00
Mikko Koppanen
2f44faa7ce Merge pull request #247 from pieterh/sendrecv
Added zmq_msg_send/recv functions
2012-02-16 08:58:03 -08:00
Pieter Hintjens
d092f2615c Renamed peek/poke to get/set 2012-02-15 19:28:29 -06:00
Pieter Hintjens
dcc1725a90 Renamed zmq_getmsgopt to zmq_msg_peek
* Added zmq_msg_poke for orthogonality
* Added zmq_msg_more for simplicity
* Fixed up man pages and test program
2012-02-15 18:44:28 -06:00
Pieter Hintjens
fb4748f257 Added zmq_msg_send/recv functions 2012-02-15 15:37:35 -06:00
Pieter Hintjens
0c4a19c408 Deprecated XREQ/XREP 2012-02-15 10:48:31 -06:00
Ian Barber
b6c97230ed Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-14 23:10:15 +00:00
Ian Barber
b5d3373905 Moving to std::string in options 2012-02-14 23:10:06 +00:00
skaller
4807935605 Implement type safe sockets and contexts. 2012-02-12 10:15:51 +11:00
Ian Barber
91bf4944da Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-11 15:08:23 +00:00
Ian Barber
7fa14f3823 Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-08 22:06:50 +00:00
Ian Barber
7b32c9cb51 Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets 2012-02-08 22:06:46 +00:00
skaller
c3f7543ebe Fix uio support.
We have to use an incomplete type in the interface.
The definition of iovec is only in the implementation.
This appears to following existing practice in 0MQ.
It seems a bit flakey that zmq.h is not included in zmq.cpp,
which is normal practice to ensure the implementation matches
the specified interface. YMMV. I follow 0MQ style.
2012-02-08 13:15:47 +11:00
skaller
970a005399 Provide interface.
Also move iovec definition from implementation to interface.
Not clear to me at present if an incomplete type should
be used to avoid gratuitously including <sys/uio.h> in
the interface. The interface can't be used with this include.
2012-02-08 12:58:35 +11:00
skaller
520ad3c2d7 Set and arrange propagation of thread safe sockets flag.
We use a distinct context initialisation function to specify
all sockets derived therefrom will be thread safe.

However the inheritance is done exclusively in the C interface.
This is not really correct, but it is chosen to minimise
interference with the existing C++ code, including any
construct or other calls within the C++ code base.
Semantically the C++ code should be unchanged,
physically some data structures and extra methods are
provided by they're only used from the C binding.
2012-02-04 02:17:35 +11:00
Martin Sustrik
6f32361fea Version bumped to 3.1.1
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-19 15:43:38 +01:00
Chuck Remes
93529d8c5d Add zmq_getmsgopt to the API
The new function allows to retrieve options (flags)
from zmq_msg_t.

Signed-off-by: Chuck Remes <cremes@mac.com>
Renamed from zmq_msg_flags to zmq_getmsgopt
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-06 14:03:51 +01:00
Martin Sustrik
fe81827bd0 Version changed to 3.1.0
This version downgrade is done because of the previous refatoring.
It removed all the new features and reintroduced some of the old
ones (identities). Thus, it made trunk much closer to existing 3.0
branch than it used to be.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-05 10:18:38 +01:00
Martin Sustrik
21a0b49834 Obsolete ECANTROUTE errror code removed
This error code was used only by new-style ROUTER socket
which is not a part of the codebase.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-05 10:10:44 +01:00
Martin Sustrik
d20ea25b8c ZMQ_IDENTITY option re-introduced
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-02 14:33:58 +01:00
Martin Sustrik
8e21d64c97 Copyright dates adjusted to reflect reality
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 18:06:11 +01:00
Martin Sustrik
7842c71073 LABELS and COMMANDs removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 13:39:54 +01:00
Martin Sustrik
ac7717b7b3 250bpm copyrights added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 16:20:30 +01:00
Martin Sustrik
9227c38933 ROUTER and DEALER are aliases for XREP and XREQ
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 15:51:11 +01:00
Martin Sustrik
dee8b2360a New style ROUTER socket removed.
Signed-off-by: Martin Sustrik <sustrik@turist.(none)>
2011-10-31 15:44:42 +01:00
Martin Sustrik
940c5b346b zmq_msg_t changed to structure
zmq_msg_t being defined as unsigned char[32] could not be stored
in STL containers. Fixed by this commit.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-31 15:23:00 +02:00
Martin Sustrik
714d3b288f EAFNOSUPPORT defined on Windows platform
Windows headers don't defined this error.
This patch defines it if not already defined.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-15 20:39:48 +02:00
Steven McCoy
784041f5b9 ZMQ_IPV4ONLY option added
At this point option exists, is documented and can be set,
however, it has no effect.

Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-08-08 12:10:31 +02:00
Martin Sustrik
a1e09facb2 ROUTER socket reports error when message cannot be routed
Till now, message was silently dropped if it was sent to
a non-existent peer. Now, ECANTROUTE error is returned.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-21 18:54:27 +02:00
Martin Sustrik
72a793f78a ZMQ_GENERIC renamed to ZMQ_ROUTER
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-21 18:43:50 +02:00
Martin Sustrik
bf78e230ad GENERIC socket type and COMMAND flag added
GENERIC allows to use 0MQ as a dumb networking framework.
It provides user with connect/disconnect notifications.
Also, each inbound message is labeled by ID of the connection
it originated from. Outbound messages should be labeled by
the ID of the connection to send them to.

To distinguish connect/disconnect notifications from common
messages, COMMAND flag was introduced.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-17 23:31:29 +02:00
Martin Sustrik
c8e8f2a24c ZMQ_IDENTITY socket option removed
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 11:24:33 +02:00
Martin Sustrik
e4f98d1e10 ROUTER and DEALER sockets removed
To be replaced by new generic socket type

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 08:16:40 +02:00
Martin Sustrik
73630de98a Version number bumped to 4.0.0
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 08:11:42 +02:00
Martin Sustrik
d7adc3f19a ZMQ_FILTER option removed
The filtering is now done depending on the socket type. SUB socket
filters the messages (end-to-end filtering) while XSUB relies
on upstream nodes to do (imprefect) filtering.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-11 09:57:59 +02:00
Martin Sustrik
a28928fe37 Introduce ZMQ_ROUTER and ZMQ_DEALER sockets
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 13:36:18 +02:00
Martin Sustrik
ab99975ad4 LABEL flag added to the wire format
So far there was no distinction between message parts used by 0MQ
and message parts used by user. Now, the message parts used by 0MQ
are marked as 'LABEL'.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 11:33:54 +02:00
Martin Sustrik
4b60023b96 Merge branch 'master' of github.com:zeromq/libzmq 2011-06-19 09:15:06 +02:00
Steven McCoy
9b795de4af Refactor Windows versioning and WinSock usage.Signed-off-by: Steven McCoy <steven.mccoy@miru.hk> 2011-06-18 20:44:03 +02:00
Fabien Ninoles
d7923f08ca Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO.
- Add doc and tests
- Add options and setup
- Wait using poll/select

Signed-off-by: Fabien Ninoles <fabien@tzone.org>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-17 12:22:02 +02:00
Martin Sustrik
ff93f54653 ZMQ_FILTER socket option added
This option is a performance tweak. In devices XSUB socket filters
the messages just to send them to XPUB socket which filters them
once more. Setting ZMQ_FILTER option to 0 allows to switch the
filtering in XSUB socket off.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-12 15:24:08 +02:00
Martin Sustrik
5d0cffc52f ZMQ_MULTICAST_HOPS socket option added
Sets the time-to-live field in every multicast packet sent from the socket.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-15 18:25:43 +02:00
Martin Sustrik
e0246e32d7 Message-related functionality factored out into msg_t class.
This patch addresses serveral issues:
1. It gathers message related functionality scattered over whole
   codebase into a single class.
2. It makes zmq_msg_t an opaque datatype. Internals of the class
   don't pollute zmq.h header file.
3. zmq_msg_t size decreases from 48 to 32 bytes. That saves ~33%
   of memory in scenarios with large amount of small messages.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-21 22:27:48 +02:00
Martin Sustrik
581697695a Message validity is checked in the runtime
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-19 08:08:15 +02:00
Martin Sustrik
0839cceac9 Missing ENOTSOCK added on Win32
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-09 09:46:59 +02:00
Martin Sustrik
abb184a051 ZMQ_NOBLOCK renamed ZMQ_DONTWAIT
Done because of POSIX compliance

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-26 10:38:40 +01:00
Martin Sustrik
bc4a1ce334 ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWM
These new options allow to control the maximum size of the
inbound and outbound message pipe separately.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 16:47:33 +01:00
Martin Sustrik
a2252de2bc ZMQ_RECOVERY_IVL and ZMQ_RECOVERY_IVL_MSEC reconciled
There's only one option now -- ZMQ_RECOVRY_IVL --
and it's measured in milliseconds.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 14:36:40 +01:00
Martin Sustrik
8463b4d55e SWAP functionality removed
On-disk storage should be implemented in devices rather than
in 0MQ core. 0MQ is a networking library and there's no point
in storing network buffers on disk.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 12:27:06 +01:00
Martin Sustrik
fb27a000d9 send/recv was changed to send/recv/sendmsg/recvmsg
send/recv now complies with POSIX by using raw buffers instead
of message objects and by returning number of bytes sent/recvd
instead of 0/-1.

The return value is changed accordingly for sendmsg and recvmsg.

Note that related man pages will be fixed in a separate patch.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 11:53:55 +01:00