- net: split socket creation out of connection
Also, check for the correct error during socket creation
- net: Move IsSelectableSocket check into socket creation
We use select in ConnectSocketDirectly, so this check needs to happen before
that.
IsSelectableSocket will not be relevant after upcoming changes to remove select.
- net: use CreateSocket for binds
- net: pass socket closing responsibility up to caller for outgoing connections
This allows const references to be passed around, making it clear where the
socket may and may not be invalidated.
This is a backport of Core PR11363