Skip to content

Commit

Permalink
LibCore: Remove CSocket's bind() and listen().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
awesomekling committed Jul 27, 2019
1 parent fe45f5a commit e7957db
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 28 deletions.
8 changes: 0 additions & 8 deletions Libraries/LibCore/CLocalSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions Libraries/LibCore/CLocalSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ class CLocalSocket final : public CSocket {
explicit CLocalSocket(CObject* parent = nullptr);
CLocalSocket(Badge<CLocalServer>, int fd, CObject* parent = nullptr);
virtual ~CLocalSocket() override;

virtual bool bind(const CSocketAddress&) override;
};
7 changes: 0 additions & 7 deletions Libraries/LibCore/CSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 0 additions & 4 deletions Libraries/LibCore/CSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class CSocket : public CIODevice {
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&);

Expand Down
5 changes: 0 additions & 5 deletions Libraries/LibCore/CTCPSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@ CTCPSocket::CTCPSocket(CObject* parent)
CTCPSocket::~CTCPSocket()
{
}

bool CTCPSocket::bind(const CSocketAddress&)
{
ASSERT_NOT_REACHED();
}
2 changes: 0 additions & 2 deletions Libraries/LibCore/CTCPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ class CTCPSocket final : public CSocket {
public:
explicit CTCPSocket(CObject* parent = nullptr);
virtual ~CTCPSocket() override;

virtual bool bind(const CSocketAddress&) override;
};

0 comments on commit e7957db

Please sign in to comment.