This pull request mostly aims to improve offset guessing error handling in NetTracer, making it retry connections and guessing a few times on failure. This way, it is less dependent on the environment in making another attempt. Previously, when, for example, connect failed or one of the offsets wasn't guessed correctly, whole NetTracer crashed. Handling connection and guessing errors inside NetTracer also allows more granular restarts, restarting only what is necessary. Furthermore, the introduced port randomization allows NetTracer to run on a different port in case the default one is already used.
Additionally, some refactoring was done to make offsetguess.cpp easier to read. I'd recommend going through the pull request commit by commit.
This pull request mostly aims to improve offset guessing error handling in NetTracer, making it retry connections and guessing a few times on failure. This way, it is less dependent on the environment in making another attempt. Previously, when, for example, connect failed or one of the offsets wasn't guessed correctly, whole NetTracer crashed. Handling connection and guessing errors inside NetTracer also allows more granular restarts, restarting only what is necessary. Furthermore, the introduced port randomization allows NetTracer to run on a different port in case the default one is already used.
Additionally, some refactoring was done to make offsetguess.cpp easier to read. I'd recommend going through the pull request commit by commit.