Merge pull request #206 from MikePlayle/master
Add method to return the amount of queued outgoing data
This commit is contained in:
commit
0eb14c9756
|
|
@ -122,6 +122,12 @@ public:
|
|||
*/
|
||||
int fileno() const;
|
||||
|
||||
/**
|
||||
* The number of outgoing bytes queued on this connection.
|
||||
* @return size_t
|
||||
*/
|
||||
size_t bytesQueued() const;
|
||||
|
||||
/**
|
||||
* Process the TCP connection
|
||||
*
|
||||
|
|
|
|||
|
|
@ -336,6 +336,12 @@ public:
|
|||
*/
|
||||
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
|
||||
* @param monitor Object that can be used to find out if connection object is still alive
|
||||
|
|
|
|||
|
|
@ -158,6 +158,12 @@ public:
|
|||
*/
|
||||
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
|
||||
* @param monitor Monitor to check if the object is still alive
|
||||
|
|
|
|||
|
|
@ -43,6 +43,15 @@ int TcpConnection::fileno() const
|
|||
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
|
||||
* This method should be called when the filedescriptor that is registered
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ public:
|
|||
*/
|
||||
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
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue