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>
std::shared_ptr<Sock> m_sock;
https://github.com/bitcoin/bitcoin/issues/21744 for details.