added connection::usable()
This commit is contained in:
parent
a80847dc5e
commit
6432ce2ec1
|
|
@ -195,6 +195,16 @@ public:
|
|||
{
|
||||
return _implementation.expected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the connection in a usable state, or is it already closed or
|
||||
* in the process of being closed?
|
||||
* @return bool
|
||||
*/
|
||||
bool usable() const
|
||||
{
|
||||
return _implementation.usable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the connection
|
||||
|
|
|
|||
|
|
@ -252,6 +252,15 @@ public:
|
|||
// state must be connected
|
||||
return _state == state_closed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the connection in a usable state / not yet closed?
|
||||
* @return bool
|
||||
*/
|
||||
bool usable() const
|
||||
{
|
||||
return (_state == state_protocol || _state == state_handshake || _state == state_connected) && !_closed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the connection as ready
|
||||
|
|
|
|||
|
|
@ -236,6 +236,15 @@ public:
|
|||
*/
|
||||
bool close(bool immediate = false);
|
||||
|
||||
/**
|
||||
* Is the connection in a usable state / not yet closed or being closed
|
||||
* @return bool
|
||||
*/
|
||||
bool usable() const
|
||||
{
|
||||
return _connection.usable();
|
||||
}
|
||||
|
||||
/**
|
||||
* The max frame size. Useful if you set up a buffer to parse incoming data: it does not have to exceed this size.
|
||||
* @return uint32_t
|
||||
|
|
|
|||
Loading…
Reference in New Issue