socket error code handling