diff options
Diffstat (limited to 'Libraries/LibCore/CTCPSocket.cpp')
-rw-r--r-- | Libraries/LibCore/CTCPSocket.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Libraries/LibCore/CTCPSocket.cpp b/Libraries/LibCore/CTCPSocket.cpp new file mode 100644 index 0000000000..5f3702a482 --- /dev/null +++ b/Libraries/LibCore/CTCPSocket.cpp @@ -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() +{ +} |