Skip to content

Commit

Permalink
Add methods to get frame_max and heartbeat of the connection
Browse files Browse the repository at this point in the history
  • Loading branch information
pinepain committed Feb 11, 2015
1 parent af04748 commit 5348c69
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions librabbitmq/amqp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,36 @@ AMQP_PUBLIC_FUNCTION
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
*
Expand Down
10 changes: 10 additions & 0 deletions librabbitmq/amqp_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5348c69

Please sign in to comment.