mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 16:55:07 +00:00
LibGUI: Add GTCPSocket and base class GSocket (inherits from GIODevice.)
And use these to do the line-by-line reading automagically instead of having that logic in IRCClient. This will definitely come in handy.
This commit is contained in:
parent
d466f2634d
commit
8e3d0a23d5
12 changed files with 267 additions and 86 deletions
|
@ -40,17 +40,3 @@ bool GFile::open(GIODevice::OpenMode mode)
|
|||
set_mode(mode);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GFile::close()
|
||||
{
|
||||
if (fd() < 0 || mode() == NotOpen)
|
||||
return false;
|
||||
int rc = ::close(fd());
|
||||
if (rc < 0) {
|
||||
set_error(rc);
|
||||
return false;
|
||||
}
|
||||
set_fd(-1);
|
||||
set_mode(GIODevice::NotOpen);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue