diff --git a/include/amqpcpp/linux_tcp/tcpconnection.h b/include/amqpcpp/linux_tcp/tcpconnection.h index b096b47..15709a0 100644 --- a/include/amqpcpp/linux_tcp/tcpconnection.h +++ b/include/amqpcpp/linux_tcp/tcpconnection.h @@ -122,12 +122,6 @@ public: */ int fileno() const; - /** - * The number of outgoing bytes queued on this connection. - * @return size_t - */ - size_t bytesQueued() const; - /** * Process the TCP connection * @@ -161,7 +155,7 @@ public: } /** - * The max frame size + * 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 */ uint32_t maxFrame() const @@ -170,7 +164,7 @@ public: } /** - * The number of bytes that can best be passed to the next call to the parse() method + * The number of bytes that can best be passed to the next call to the parse() method. * @return uint32_t */ uint32_t expected() const @@ -179,7 +173,7 @@ public: } /** - * Return the amount of channels this connection has + * Return the number of channels this connection has. * @return std::size_t */ std::size_t channels() const @@ -187,6 +181,12 @@ public: // return the amount of channels this connection has return _connection.channels(); } + + /** + * The number of outgoing bytes queued on this connection. + * @return std::size_t + */ + std::size_t queued() const; /** * Send a heartbeat diff --git a/src/linux_tcp/sslconnected.h b/src/linux_tcp/sslconnected.h index ad56208..fd980f0 100644 --- a/src/linux_tcp/sslconnected.h +++ b/src/linux_tcp/sslconnected.h @@ -337,11 +337,11 @@ public: virtual int fileno() const override { return _socket; } /** - * The number of outgoing bytes queued on this connection. - * @return size_t + * Number of bytes in the outgoing buffer + * @return std::size_t */ - virtual size_t bytesQueued() const { return _out.size(); } - + virtual std::size_t queued() const override { 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 diff --git a/src/linux_tcp/sslhandshake.h b/src/linux_tcp/sslhandshake.h index caa1b4f..064d181 100644 --- a/src/linux_tcp/sslhandshake.h +++ b/src/linux_tcp/sslhandshake.h @@ -171,6 +171,12 @@ public: * @return int */ virtual int fileno() const override { return _socket; } + + /** + * Number of bytes in the outgoing buffer + * @return std::size_t + */ + virtual std::size_t queued() const override { return _out.size(); } /** * Process the filedescriptor in the object diff --git a/src/linux_tcp/tcpconnected.h b/src/linux_tcp/tcpconnected.h index 83a1a4d..34b6c47 100644 --- a/src/linux_tcp/tcpconnected.h +++ b/src/linux_tcp/tcpconnected.h @@ -159,10 +159,10 @@ public: virtual int fileno() const override { return _socket; } /** - * The number of outgoing bytes queued on this connection. - * @return size_t + * Number of bytes in the outgoing buffer + * @return std::size_t */ - virtual size_t bytesQueued() const { return _out.size(); } + virtual std::size_t queued() const override { return _out.size(); } /** * Process the filedescriptor in the object diff --git a/src/linux_tcp/tcpconnection.cpp b/src/linux_tcp/tcpconnection.cpp index 504fcf7..b8f0cd1 100644 --- a/src/linux_tcp/tcpconnection.cpp +++ b/src/linux_tcp/tcpconnection.cpp @@ -45,11 +45,11 @@ int TcpConnection::fileno() const /** * The number of outgoing bytes queued on this connection. - * @return size_t + * @return std::size_t */ -size_t TcpConnection::bytesQueued() const +std::size_t TcpConnection::queued() const { - return _state->bytesQueued(); + return _state->queued(); } /** diff --git a/src/linux_tcp/tcpresolver.h b/src/linux_tcp/tcpresolver.h index 97e8916..5fc002a 100644 --- a/src/linux_tcp/tcpresolver.h +++ b/src/linux_tcp/tcpresolver.h @@ -184,6 +184,12 @@ public: _thread.join(); } + /** + * Number of bytes in the outgoing buffer + * @return std::size_t + */ + virtual std::size_t queued() const override { return _buffer.size(); } + /** * Proceed to the next state * @return TcpState * diff --git a/src/linux_tcp/tcpstate.h b/src/linux_tcp/tcpstate.h index c12a61c..c7660c9 100644 --- a/src/linux_tcp/tcpstate.h +++ b/src/linux_tcp/tcpstate.h @@ -4,7 +4,7 @@ * Base class / interface of the various states of the TCP connection * * @author Emiel Bruijntjes - * @copyright 2015 - 2016 Copernica BV + * @copyright 2015 - 2018 Copernica BV */ /** @@ -67,7 +67,7 @@ public: * The number of outgoing bytes queued on this connection. * @return size_t */ - virtual size_t bytesQueued() const { return 0; } + virtual std::size_t queued() const { return 0; } /** * Process the filedescriptor in the object