better error message for opening of socket