Add validity check to TCPListener

This commit is contained in:
Joshua Ashton 2020-08-02 00:55:09 +01:00
parent 5015bfc5c9
commit 818c1f55bd
2 changed files with 7 additions and 0 deletions

View File

@ -62,6 +62,11 @@ namespace Feather::Network
{
}
bool TCPListener::IsValid() const
{
return m_socket != nullptr;
}
void TCPListener::OnClientConnect(TCPClientHandle&& client)
{
m_callbacks->OnClientConnect(std::move(client));

View File

@ -13,6 +13,8 @@ namespace Feather::Network
TCPListener(uint16_t port, IListenerInterface* callbacks);
~TCPListener();
bool IsValid() const;
protected:
friend class TCPClient;