mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:37:44 +00:00
LibCore+Userland: Remove Core::TCPSocket :^)
This was deprecated in favor of Core::Stream::TCPSocket, and now has no users.
This commit is contained in:
parent
cb57475168
commit
64f135d90f
10 changed files with 1 additions and 83 deletions
|
@ -33,7 +33,6 @@ set(SOURCES
|
|||
System.cpp
|
||||
SystemServerTakeover.cpp
|
||||
TCPServer.cpp
|
||||
TCPSocket.cpp
|
||||
TempFile.cpp
|
||||
Timer.cpp
|
||||
UDPServer.cpp
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <LibCore/Notifier.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibCore/TCPServer.h>
|
||||
#include <LibCore/TCPSocket.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/TCPSocket.h>
|
||||
#include <errno.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#ifndef SOCK_NONBLOCK
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
|
||||
TCPSocket::TCPSocket(int fd, Object* parent)
|
||||
: Socket(Socket::Type::TCP, parent)
|
||||
{
|
||||
// NOTE: This constructor is used by TCPServer::accept(), so the socket is already connected.
|
||||
m_connected = true;
|
||||
set_fd(fd);
|
||||
set_mode(OpenMode::ReadWrite);
|
||||
set_error(0);
|
||||
}
|
||||
|
||||
TCPSocket::TCPSocket(Object* parent)
|
||||
: Socket(Socket::Type::TCP, parent)
|
||||
{
|
||||
#ifdef SOCK_NONBLOCK
|
||||
int fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
|
||||
#else
|
||||
int fd = socket(AF_INET, SOCK_STREAM, 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);
|
||||
}
|
||||
}
|
||||
|
||||
TCPSocket::~TCPSocket()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <LibCore/Socket.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
class TCPSocket final : public Socket {
|
||||
C_OBJECT(TCPSocket)
|
||||
public:
|
||||
virtual ~TCPSocket() override;
|
||||
|
||||
private:
|
||||
TCPSocket(int fd, Object* parent = nullptr);
|
||||
explicit TCPSocket(Object* parent = nullptr);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue