Page MenuHomePhabricator

net: Split socket create/connect
ClosedPublic

Authored by deadalnix on Oct 3 2018, 15:51.

Details

Summary
  • 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

Depends on D1870, D1871 and D1873

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Oct 5 2018, 05:46
This revision was automatically updated to reflect the committed changes.