The outcome is that if you connect to a socket which immediately resets the connection, the error cannot be handled.
An example of this would be connecting to a socket which immediately closes the socket (e.g. due to a firewall rule).
You can simulate this with iptables like so:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 61613 -j REJECT --reject-with tcp-reset
One dirty fix would be for the default droppedHandler to call resultHandler with a failed future (instead of just doing nothing), however, I think the code would benefit from a slight refactor instead.
I provided a fix in master where the connect method receives a failure in this case. You can also setup an exception handler on the client to collect errors.
The outcome is that if you connect to a socket which immediately resets the connection, the error cannot be handled.
An example of this would be connecting to a socket which immediately closes the socket (e.g. due to a firewall rule).
You can simulate this with iptables like so:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 61613 -j REJECT --reject-with tcp-reset
One dirty fix would be for the default droppedHandler to call resultHandler with a failed future (instead of just doing nothing), however, I think the code would benefit from a slight refactor instead.