mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-17 21:26:44 +00:00
LibCore: Move GIODevice hierarchy from LibGUI to LibCore.
This commit is contained in:
19
LibCore/CTCPSocket.cpp
Normal file
19
LibCore/CTCPSocket.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <LibCore/CTCPSocket.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
CTCPSocket::CTCPSocket(CObject* parent)
|
||||
: CSocket(CSocket::Type::TCP, parent)
|
||||
{
|
||||
int fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||
if (fd < 0) {
|
||||
set_error(fd);
|
||||
} else {
|
||||
set_fd(fd);
|
||||
set_mode(CIODevice::ReadWrite);
|
||||
set_error(0);
|
||||
}
|
||||
}
|
||||
|
||||
CTCPSocket::~CTCPSocket()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user