diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 10:13:34 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 15:25:08 +0200 |
commit | 4298ba25c3b9909781cebc4719af82056591572b (patch) | |
tree | 3db1fec1e15388d8cd60054bff990e9ffef8fbfc /Libraries/LibCore/CTCPServer.h | |
parent | 1f5a9762a2b9e3449be7e61327c100d2e1f3e9db (diff) | |
download | serenity-4298ba25c3b9909781cebc4719af82056591572b.zip |
LibCore: Convert CTCPSocket to ObjectPtr, add construct() helper
The C_OBJECT macro now also inserts a static construct(...) helper into
the class. Now we can make the constructor(s) private and instead call:
auto socket = CTCPSocket::construct(arguments);
construct() returns an ObjectPtr<T>, which we'll later switch to being
a NonnullRefPtr<T>, once everything else in in place for ref-counting.
Diffstat (limited to 'Libraries/LibCore/CTCPServer.h')
-rw-r--r-- | Libraries/LibCore/CTCPServer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibCore/CTCPServer.h b/Libraries/LibCore/CTCPServer.h index 09b3852118..67b551e22c 100644 --- a/Libraries/LibCore/CTCPServer.h +++ b/Libraries/LibCore/CTCPServer.h @@ -15,7 +15,7 @@ public: bool is_listening() const { return m_listening; } bool listen(const IPv4Address& address, u16 port); - CTCPSocket* accept(); + ObjectPtr<CTCPSocket> accept(); Function<void()> on_ready_to_accept; |