LibCore: Remove CSocket's bind() and listen().

We're going to be using dedicated server socket classes instead.
This was only implemented for CLocalSocket, and clients have been switched
over to using CLocalServer.
This commit is contained in:
Andreas Kling 2019-07-27 10:57:30 +02:00
parent fe45f5a6d2
commit e7957db173
Notes: sideshowbarker 2024-07-19 13:02:04 +09:00
6 changed files with 0 additions and 28 deletions

View file

@ -26,11 +26,3 @@ CLocalSocket::CLocalSocket(CObject* parent)
CLocalSocket::~CLocalSocket()
{
}
bool CLocalSocket::bind(const CSocketAddress& address)
{
auto un = address.to_sockaddr_un();
int rc = ::bind(fd(), (const sockaddr*)&un, sizeof(un));
set_error(errno);
return rc == 0;
}

View file

@ -11,6 +11,4 @@ public:
explicit CLocalSocket(CObject* parent = nullptr);
CLocalSocket(Badge<CLocalServer>, int fd, CObject* parent = nullptr);
virtual ~CLocalSocket() override;
virtual bool bind(const CSocketAddress&) override;
};

View file

@ -131,13 +131,6 @@ bool CSocket::send(const ByteBuffer& data)
return true;
}
bool CSocket::listen()
{
int rc = ::listen(fd(), 5);
set_error(errno);
return rc == 0;
}
void CSocket::did_update_fd(int fd)
{
if (fd < 0) {

View file

@ -22,10 +22,6 @@ public:
bool connect(const CSocketAddress&, int port);
bool connect(const CSocketAddress&);
virtual bool bind(const CSocketAddress&) = 0;
bool listen();
ByteBuffer receive(int max_size);
bool send(const ByteBuffer&);

View file

@ -17,8 +17,3 @@ CTCPSocket::CTCPSocket(CObject* parent)
CTCPSocket::~CTCPSocket()
{
}
bool CTCPSocket::bind(const CSocketAddress&)
{
ASSERT_NOT_REACHED();
}

View file

@ -5,6 +5,4 @@ class CTCPSocket final : public CSocket {
public:
explicit CTCPSocket(CObject* parent = nullptr);
virtual ~CTCPSocket() override;
virtual bool bind(const CSocketAddress&) override;
};