making sure socket is closed
meta support for different authentication mechanisms