UniversalRobots / Universal_Robots_ExternalControl_URCap

CB3 and E-Series URCap for the ROS and ROS2 drivers
Apache License 2.0
65 stars 16 forks source link

Connecting to a machine with an active firewall blocks for a long time #8

Closed fmauch closed 4 years ago

fmauch commented 4 years ago

As this URCap tries to receive script code from a remote host in each program as soon as it is installed (see #1), this is quite serious.

When having a remote machine connected, that blocks remote connections, the installation part will try to connect to the remote machine for a very long time (see https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/74 and https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/237).

Depending on the reason for being blocked, this may lead into an IOException (in case of an active firewall) or into some other exception (in case of a misconfigured IP setup? as in https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/237).

To reproduce this:

Setup this URCap with a working ROS driver, then activate a firewall on the remote machine by installing ufw and then

sudo ufw default deny
sudo ufw enable

Starting any program on the TP will result in a long program start with a "In progress" popup message until finally raising the popup from this line.

I am no java expert, but my assumption is that we could tune a timeout parameter somewhere in the connection setup. The connect() method offers this, but currently isn't directly used. The connection attempt could be changed to setup a custom timeout. However, I think solving #1 should be the preferred way to mitigate this which is why I currently don't plan to put any effort into this.

gavanderhoorn commented 4 years ago

I am no java expert, but my assumption is that we could tune a timeout parameter somewhere in the connection setup. The connect() method offers this, but currently isn't directly used.

Indeed. See #9.

fmauch commented 4 years ago

Closing this, as #1 and #9 are merged.