Rosanswers logo

Hi All:

Here is one question about the "rostopic". Can client rosnode send message to the topic when server rosnode is off? or vice versa. The topic concept is also be used in MQTT protocol. In their MQTT website description, the action of sending messages from one node to another through topic does not need to concern about the received one condition(that means received one can be on or off state) due to the waste of long-term internet connections and the occupitation of the internet bandwidth ?

Originally posted by PaulTsai111 on ROS Answers with karma: 3 on 2016-11-03

Post score: 0

Original comments

Comment by mgruhler on 2016-11-04:
@JoshMarino why not post this as an answer? :-)

Comment by NEngelhard on 2016-11-04:
"A publisher sends the message regardless if anyone listens to it or not." How is this possible if messages are transported via TCP? Or do you just mean that the .publish(msg) does not block if there is no listener?

Comment by gvdhoorn on 2016-11-05:
publish(..) never blocks.

And whether TCP is used or not doesn't matter: if there are no subscribers, there are no connections between nodes, so the middleware will simply discard the msg passed to it by the various .publish(..) methods.

Only nodes exchange msgs, the master is not involved.


1 Answer 1


Rosanswers logo

A publisher sends the message regardless if anyone listens to it or not.

A subscriber will not enter its callback function if no message is received. The subscriber can still be running though and doing nothing if no message is ever received.

Originally posted by JoshMarino with karma: 592 on 2016-11-03

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.