summaryrefslogtreecommitdiff
path: root/LibCore/CTCPSocket.cpp
blob: 5f3702a4820004ac2e611ad24a75d02a9c2770f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()
{
}