1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

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

This commit is contained in:
sin-ack 2022-02-06 17:28:45 +00:00 committed by Andreas Kling
parent 11a2e31306
commit 285b2fba96
4 changed files with 0 additions and 65 deletions

View file

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

View file

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

View file

@ -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()
{
}
}

View file

@ -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);
};
}