1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

LibGUI: Make GSocket connection asynchronous.

Now connect() will return immediately. Later on, when the socket is actually
connected, it will call GSocket::on_connected from the event loop. :^)
This commit is contained in:
Andreas Kling 2019-04-08 04:53:45 +02:00
parent 65d6318c33
commit 6d5a54690e
11 changed files with 65 additions and 29 deletions

View file

@ -145,7 +145,7 @@ bool GIODevice::populate_read_buffer()
{
if (m_fd < 0)
return false;
auto buffer = ByteBuffer::create_uninitialized(1024);
auto buffer = ByteBuffer::create_uninitialized(PAGE_SIZE);
int nread = ::read(m_fd, buffer.pointer(), buffer.size());
if (nread < 0) {
set_error(errno);