From bb4e4921c06e1d077eb5f638cb7ade8aeba07562 Mon Sep 17 00:00:00 2001 From: Conrad Pankoff Date: Wed, 16 Dec 2020 18:16:15 +1100 Subject: [PATCH] LibCore: Expose some Socket properties to make then inspectable --- Libraries/LibCore/Socket.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Libraries/LibCore/Socket.cpp b/Libraries/LibCore/Socket.cpp index 5ad2beb1f3..052a20d0db 100644 --- a/Libraries/LibCore/Socket.cpp +++ b/Libraries/LibCore/Socket.cpp @@ -45,6 +45,25 @@ Socket::Socket(Type type, Object* parent) : IODevice(parent) , m_type(type) { + register_property( + "source_address", [this] { return m_source_address.to_string(); }, + [](auto&) { return false; }); + + register_property( + "destination_address", [this] { return m_destination_address.to_string(); }, + [](auto&) { return false; }); + + register_property( + "source_port", [this] { return m_source_port; }, + [](auto&) { return false; }); + + register_property( + "destination_port", [this] { return m_destination_port; }, + [](auto&) { return false; }); + + register_property( + "connected", [this] { return m_connected; }, + [](auto&) { return false; }); } Socket::~Socket()