better error messages on socket error
unused function