Better ldap socket message handling