summaryrefslogtreecommitdiff
path: root/LibGUI/GTCPSocket.cpp
blob: ad53027674289503a8653d83571f147001a405a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <LibGUI/GTCPSocket.h>
#include <sys/socket.h>

GTCPSocket::GTCPSocket(GObject* parent)
    : GSocket(GSocket::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(GIODevice::ReadWrite);
        set_error(0);
    }
}

GTCPSocket::~GTCPSocket()
{
}