mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibCore: Mark Socket::{common_,}connect() virtual and add a on_write
This commit is contained in:
parent
f1578d7e9e
commit
7eb72c72e8
Notes:
sideshowbarker
2024-07-19 07:05:11 +09:00
Author: https://github.com/alimpfard
Commit: 7eb72c72e8
Pull-request: https://github.com/SerenityOS/serenity/pull/1661
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/itamar8910
2 changed files with 18 additions and 16 deletions
|
@ -45,7 +45,7 @@ public:
|
|||
|
||||
Type type() const { return m_type; }
|
||||
|
||||
bool connect(const String& hostname, int port);
|
||||
virtual bool connect(const String& hostname, int port);
|
||||
bool connect(const SocketAddress&, int port);
|
||||
bool connect(const SocketAddress&);
|
||||
|
||||
|
@ -63,6 +63,7 @@ public:
|
|||
|
||||
Function<void()> on_connected;
|
||||
Function<void()> on_ready_to_read;
|
||||
Function<void()> on_ready_to_write;
|
||||
|
||||
protected:
|
||||
Socket(Type, Object* parent);
|
||||
|
@ -74,10 +75,10 @@ protected:
|
|||
bool m_connected { false };
|
||||
|
||||
virtual void did_update_fd(int) override;
|
||||
virtual bool common_connect(const struct sockaddr*, socklen_t);
|
||||
|
||||
private:
|
||||
virtual bool open(IODevice::OpenMode) override { ASSERT_NOT_REACHED(); }
|
||||
bool common_connect(const struct sockaddr*, socklen_t);
|
||||
void ensure_read_notifier();
|
||||
|
||||
Type m_type { Type::Invalid };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue