1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibCore: Mark Socket::{common_,}connect() virtual and add a on_write

This commit is contained in:
AnotherTest 2020-04-19 12:57:13 +04:30 committed by Andreas Kling
parent f1578d7e9e
commit 7eb72c72e8
2 changed files with 18 additions and 16 deletions

View file

@ -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 };