diff options
author | Bogdan Padalko <pinepain@gmail.com> | 2015-02-09 23:12:30 +0200 |
---|---|---|
committer | Bogdan Padalko <pinepain@gmail.com> | 2015-02-11 08:59:27 +0200 |
commit | 5348c697a0d6609d034d7bf571efc933556269a7 (patch) | |
tree | b00c0aabf299c2a3862dfa4c0d105ec17c81af40 | |
parent | af04748b78c8582d71c2923b4fcd608535a84157 (diff) | |
download | rabbitmq-c-5348c697a0d6609d034d7bf571efc933556269a7.tar.gz |
Add methods to get frame_max and heartbeat of the connection
-rw-r--r-- | librabbitmq/amqp.h | 30 | ||||
-rw-r--r-- | librabbitmq/amqp_connection.c | 10 |
2 files changed, 40 insertions, 0 deletions
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 13d2f7f..20fa642 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -1098,6 +1098,36 @@ int AMQP_CALL amqp_get_channel_max(amqp_connection_state_t state); /** + * Get the maximum size of an frame the connection can handle + * + * The maximum size of an frame is set when connection negotiation takes + * place in amqp_login() or amqp_login_with_properties(). + * + * \param [in] state the connection object + * \return the maximum size of an frame. + * + * \since v0.6 + */ +AMQP_PUBLIC_FUNCTION +int +AMQP_CALL amqp_get_frame_max(amqp_connection_state_t state); + +/** + * Get the number of seconds between heartbeats of the connection + * + * The number of seconds between heartbeats is set when connection + * negotiation takes place in amqp_login() or amqp_login_with_properties(). + * + * \param [in] state the connection object + * \return the number of seconds between heartbeats. + * + * \since v0.6 + */ +AMQP_PUBLIC_FUNCTION +int +AMQP_CALL amqp_get_heartbeat(amqp_connection_state_t state); + +/** * Destroys an amqp_connection_state_t object * * Destroys a amqp_connection_state_t object that was created with diff --git a/librabbitmq/amqp_connection.c b/librabbitmq/amqp_connection.c index 3315969..3bb6dca 100644 --- a/librabbitmq/amqp_connection.c +++ b/librabbitmq/amqp_connection.c @@ -170,6 +170,16 @@ int amqp_get_channel_max(amqp_connection_state_t state) return state->channel_max; } +int amqp_get_frame_max(amqp_connection_state_t state) +{ + return state->frame_max; +} + +int amqp_get_heartbeat(amqp_connection_state_t state) +{ + return state->heartbeat; +} + int amqp_destroy_connection(amqp_connection_state_t state) { int status = AMQP_STATUS_OK; |