Better socket spec handling