Socket used for communication with the node. May not own a Sock object (after CloseSocketDisconnect() or during tests). shared_ptr (instead of unique_ptr) is used to avoid premature close of the underlying file descriptor by one thread while another thread is poll(2)-ing it for activity.
Declared in <net.h>
[[guarded_by(0x7f2e2b2a7a18), guarded_by(0x7f2e2ad13168), guarded_by(0x7f2e230317c8), guarded_by(0x7f2e26ede398), guarded_by(0x7f2e23157a18), guarded_by(0x7f2e36827298), guarded_by(0x7f2e228af9b8), guarded_by(0x7f2e431dc778), guarded_by(0x7f2e1b9fba48), guarded_by(0x7f2e2b9cf5e8), guarded_by(0x7f2e403d1ce8)]]
std::shared_ptr<Sock> m_sock;
https://github.com/bitcoin/bitcoin/issues/21744 for details.