connectivecpp / chops-net-ip

Chops Net IP ("C"onnective "H"andcrafted "Op"enwork "S"oftware), a tasty C++ library that makes asynchronous IP network coding fun!
Boost Software License 1.0
7 stars 3 forks source link

Change TCP connector to auto reconnect after connection failure #18

Closed cliffg-softwarelibre closed 5 years ago

cliffg-softwarelibre commented 5 years ago

Currently the TCP connector will not automatically attempt reconnects after a TCP connection failure. The application code is required to call "start" on the TCP connector net entity. The default behavior should be to automatically reconnect (assuming the reconnect timeout parameter is >0), and if the application does not want reconnects it can call "stop" on the net entity.

This requires careful thought about the use cases (both approaches are present in real world applications) and investigation of example and test code.

cliffg-softwarelibre commented 5 years ago

This has been implemented in the merge of June 3rd week. One more option to stop the TCP connector is to return false from the io state change callback.