summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/Socket.cpp
diff options
context:
space:
mode:
authorConrad Pankoff <deoxxa@fknsrs.biz>2020-12-16 18:16:15 +1100
committerAndreas Kling <kling@serenityos.org>2020-12-16 17:12:13 +0100
commitbb4e4921c06e1d077eb5f638cb7ade8aeba07562 (patch)
tree56694cdbe9fd7f3f4cfbb4deee7f2fc363df8cfa /Libraries/LibCore/Socket.cpp
parentee3056ba119b02b9aec5d56ba83acfc4d9478570 (diff)
downloadserenity-bb4e4921c06e1d077eb5f638cb7ade8aeba07562.zip
LibCore: Expose some Socket properties to make then inspectable
Diffstat (limited to 'Libraries/LibCore/Socket.cpp')
-rw-r--r--Libraries/LibCore/Socket.cpp19
1 files changed, 19 insertions, 0 deletions
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()