Add method to return the amount of queued outgoing data
This commit is contained in:
parent
12046f970f
commit
8800d2917e
|
|
@ -122,6 +122,12 @@ public:
|
||||||
*/
|
*/
|
||||||
int fileno() const;
|
int fileno() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of outgoing bytes queued on this connection.
|
||||||
|
* @return size_t
|
||||||
|
*/
|
||||||
|
size_t bytesQueued() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the TCP connection
|
* Process the TCP connection
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,12 @@ public:
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
virtual int fileno() const override { return _socket; }
|
virtual int fileno() const override { return _socket; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of outgoing bytes queued on this connection.
|
||||||
|
* @return size_t
|
||||||
|
*/
|
||||||
|
virtual size_t bytesQueued() const { return _out.size(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the filedescriptor in the object
|
* Process the filedescriptor in the object
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,13 @@ public:
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
virtual int fileno() const override { return _socket; }
|
virtual int fileno() const override { return _socket; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of outgoing bytes queued on this connection.
|
||||||
|
* @return size_t
|
||||||
|
*/
|
||||||
|
virtual size_t bytesQueued() const { return _out.size(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the filedescriptor in the object
|
* Process the filedescriptor in the object
|
||||||
* @param monitor Monitor to check if the object is still alive
|
* @param monitor Monitor to check if the object is still alive
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,15 @@ int TcpConnection::fileno() const
|
||||||
return _state->fileno();
|
return _state->fileno();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of outgoing bytes queued on this connection.
|
||||||
|
* @return size_t
|
||||||
|
*/
|
||||||
|
size_t TcpConnection::bytesQueued() const
|
||||||
|
{
|
||||||
|
return _state->bytesQueued();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the TCP connection
|
* Process the TCP connection
|
||||||
* This method should be called when the filedescriptor that is registered
|
* This method should be called when the filedescriptor that is registered
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,12 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int fileno() const { return -1; }
|
virtual int fileno() const { return -1; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of outgoing bytes queued on this connection.
|
||||||
|
* @return size_t
|
||||||
|
*/
|
||||||
|
virtual size_t bytesQueued() const { return 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the filedescriptor in the object
|
* Process the filedescriptor in the object
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue