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:
parent
11a2e31306
commit
285b2fba96
4 changed files with 0 additions and 65 deletions
|
@ -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>
|
||||||
|
|
|
@ -36,7 +36,6 @@ set(SOURCES
|
||||||
TempFile.cpp
|
TempFile.cpp
|
||||||
Timer.cpp
|
Timer.cpp
|
||||||
UDPServer.cpp
|
UDPServer.cpp
|
||||||
UDPSocket.cpp
|
|
||||||
Version.cpp
|
Version.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()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue