mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Allow checking if socket is valid.
This commit is contained in:
parent
02e3f45ed2
commit
65d146ddca
@ -275,6 +275,11 @@ bool Socket::HasData()
|
|||||||
return poll( &fd, 1, 0 ) > 0;
|
return poll( &fd, 1, 0 ) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Socket::IsValid() const
|
||||||
|
{
|
||||||
|
return m_sock >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ListenSocket::ListenSocket()
|
ListenSocket::ListenSocket()
|
||||||
: m_sock( -1 )
|
: m_sock( -1 )
|
||||||
|
@ -28,6 +28,7 @@ public:
|
|||||||
bool Read( void* buf, int len, int timeout, std::function<bool()> exitCb );
|
bool Read( void* buf, int len, int timeout, std::function<bool()> exitCb );
|
||||||
bool ReadRaw( void* buf, int len, int timeout );
|
bool ReadRaw( void* buf, int len, int timeout );
|
||||||
bool HasData();
|
bool HasData();
|
||||||
|
bool IsValid() const;
|
||||||
|
|
||||||
Socket( const Socket& ) = delete;
|
Socket( const Socket& ) = delete;
|
||||||
Socket( Socket&& ) = delete;
|
Socket( Socket&& ) = delete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user