Select socket correctly