Constant scaproust::proto::PUB
[−]
[src]
pub const PUB: u16=
2 * 16
Publish/subscribe protocol
Broadcasts messages to multiple destinations.
Messages are sent from Pub
sockets and will only be received
by Sub
sockets that have subscribed to the matching topic.
Topic is an arbitrary sequence of bytes at the beginning of the message body.
The Sub
socket will determine whether a message should be delivered
to the user by comparing the subscribed topics to the bytes initial bytes
in the incomming message, up to the size of the topic.
Subscribing via Socket::set_option
and ConfigOption::Subscribe
Will match any message with intial 5 bytes being "Hello", for example, message "Hello, World!" will match.
Topic with zero length matches any message.
If the socket is subscribed to multiple topics,
message matching any of them will be delivered to the user.
Since the filtering is performed on the Subscriber side,
all the messages from Publisher will be sent over the transport layer.
The entire message, including the topic, is delivered to the user.
This socket is used to distribute messages to multiple destinations. Receive operation is not defined.