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(0x7fbc93158a18), guarded_by(0x7fbc92ea02a8), guarded_by(0x7fbc86f8aad8), guarded_by(0x7fbc96fc0838), guarded_by(0x7fbc8fa75458), guarded_by(0x7fbcaf6874f8), guarded_by(0x7fbc9f561a68), guarded_by(0x7fbca705d3f8), guarded_by(0x7fbc922a27c8), guarded_by(0x7fbcaf849538), guarded_by(0x7fbc9f189a68)]]
std::shared_ptr<Sock> m_sock;
https://github.com/bitcoin/bitcoin/issues/21744 for details.