Allow checking if socket is valid.

This commit is contained in:
Bartosz Taudul
2019-12-19 17:23:40 +01:00
parent 02e3f45ed2
commit 65d146ddca
2 changed files with 6 additions and 0 deletions

View File

@@ -275,6 +275,11 @@ bool Socket::HasData()
return poll( &fd, 1, 0 ) > 0;
}
bool Socket::IsValid() const
{
return m_sock >= 0;
}
ListenSocket::ListenSocket()
: m_sock( -1 )