tcp engine improvements + new "tests" + callback interface