ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
508 stars 527 forks source link

Gracefully handle socket server end. #550

Closed Nurgak closed 3 years ago

Nurgak commented 3 years ago

When stopping the socket server the accept() method blocks until SIGTERM, this is not pretty and takes time...

I suggest a 1 second timeout which fails silently continuously if no connection is present and allows to check for the rospy.is_shutdown() condition of the while loop to end gracefully and immediately.

mikepurvis commented 3 years ago

This looks reasonable, thanks for the fix!