Selaa lähdekoodia

LibCore+Tests: Remove Core::UDPSocket :^)

sin-ack 3 vuotta sitten
vanhempi
commit
285b2fba96

+ 0 - 1
Tests/LibCore/TestLibCoreStream.cpp

@@ -11,7 +11,6 @@
 #include <LibCore/TCPServer.h>
 #include <LibCore/Timer.h>
 #include <LibCore/UDPServer.h>
-#include <LibCore/UDPSocket.h>
 #include <LibTest/TestCase.h>
 #include <LibThreading/BackgroundAction.h>
 #include <fcntl.h>

+ 0 - 1
Userland/Libraries/LibCore/CMakeLists.txt

@@ -36,7 +36,6 @@ set(SOURCES
     TempFile.cpp
     Timer.cpp
     UDPServer.cpp
-    UDPSocket.cpp
     Version.cpp
 )
 

+ 0 - 41
Userland/Libraries/LibCore/UDPSocket.cpp

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#include <LibCore/UDPSocket.h>
-#include <errno.h>
-#include <sys/socket.h>
-
-#ifndef SOCK_NONBLOCK
-#    include <sys/ioctl.h>
-#endif
-
-namespace Core {
-
-UDPSocket::UDPSocket(Object* parent)
-    : Socket(Socket::Type::UDP, parent)
-{
-#ifdef SOCK_NONBLOCK
-    int fd = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, 0);
-#else
-    int fd = socket(AF_INET, SOCK_DGRAM, 0);
-    int option = 1;
-    ioctl(fd, FIONBIO, &option);
-#endif
-
-    if (fd < 0) {
-        set_error(errno);
-    } else {
-        set_fd(fd);
-        set_mode(OpenMode::ReadWrite);
-        set_error(0);
-    }
-}
-
-UDPSocket::~UDPSocket()
-{
-}
-
-}

+ 0 - 22
Userland/Libraries/LibCore/UDPSocket.h

@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#pragma once
-
-#include <LibCore/Socket.h>
-
-namespace Core {
-
-class UDPSocket final : public Socket {
-    C_OBJECT(UDPSocket)
-public:
-    virtual ~UDPSocket() override;
-
-private:
-    explicit UDPSocket(Object* parent = nullptr);
-};
-
-}