Closed jinmenglei closed 3 years ago
this sounds reasonable to me. since transport is terminated with 'TransportTerminated' we would not want to reconnect. (in roscpp, if that is neither EAGAIN
nor EWOULDBLOCK
, it is closed and done.)
if str(e) == "unable to receive data from sender, check sender's logs for details":
instead of that, i would add except catch statement TransportTerminated
before TransportException
.
@fujitatomoya Thank you. After you fix it, I will pull the code again. I like ROS and hope that the UDP part of ros1 can be updated later.
When I use rosbridge, after I send a message, I close the client connected through rosbridge, which will result in
d = sock.recv(buff_size)
After receiving an empty string.An exception is thrown, and then the socket is reconnected. Finally, the waiting time exceeds 32S. It is difficult to connect, and the port will be wasted when reconnecting. I refer to the C + + code and find that the processing logic is different.
C + + receives zero and closes the connection directly instead of reconnecting. Can we consider closing it, like this:
The test is OK after I modify it