Message::Passing::ZeroMQ::Role::HasASocket - Role for instances which have a ZeroMQ socket.
Bind a server to an address.
Connect to a server.
This option is mutually exclusive with socket_bind, as sockets can connect in one direction only.
The connection direction can be either the same as, or the opposite of the message flow direction.
The currently supported socket types are:
This socket publishes messages to zero or more subscribers.
All subscribers get a copy of each message.
The pair of PUB, receives broadcast messages.
This socket type distributes messages in a round-robin fashion between subscribers. Therefore N subscribers will see 1/N of the message flow.
The pair of PUSH, receives a proportion of messages distributed.
Integer indicating the value of the ZMQ_LINGER options.
Defaults to 0 meaning sockets will not block on shutdown if a server is unavailable (i.e. queued messages will be discarded).
Set the High Water Mark for the socket. Depending on the socket type, messages are likely to be discarded once this high water mark is exceeded (i.e. there are more than this many messages buffered).
A value of 0 disables the high water mark, meaning that messages will be buffered until RAM runs out.
If a value this attribute is provided,
responsibility for building sockets is solely the callback's responsibility.
None of the other attributes usually involved in creating sockets,
socket_hmw will be taken into account automatically.
If a socket builder callback needs to make use of the aforementioned attributes,
it will have to do so manually by looking at the object implementing
which is going to be passed to the callback as the first argument upon invocation.
The second and final argument passed to the callback with be a newly ZeroMQ::Context that the new socket is expected to be created in.
For wrapping by sub-classes to set options after the socket is created.
This module exists due to the wonderful people at Suretec Systems Ltd. <http://www.suretecsystems.com/> who sponsored its development for its VoIP division called SureVoIP <http://www.surevoip.co.uk/> for use with the SureVoIP API - <http://www.surevoip.co.uk/support/wiki/api_documentation>