well thank you zoomkat for your code, i think i have seen it in other threads as well.
i see you are closing the connection with client.stop after sending and reading , but that does not explain why the examples does not do it or which approach is "best practice"
to be honest your code explains nothing, it is just another example.
thx for your time