diff options
author | Alan Antonuk <alan.antonuk@gmail.com> | 2013-07-03 12:35:27 -0700 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2013-07-03 12:35:27 -0700 |
commit | da9c2c109ad9740177adfc93e5e92cba92c56134 (patch) | |
tree | f89f2512aea79d7abb64aa1f7900057eae44f8c4 /librabbitmq/amqp.h | |
parent | 448ab68ac6299b73f6ccd697949d2d566d5a1a64 (diff) | |
download | rabbitmq-c-github-ask-da9c2c109ad9740177adfc93e5e92cba92c56134.tar.gz |
Make connection the socket object owner
Improve the socket interface by making the amqp_connection_state_t
object the amqp_socket_t owner, and tie its lifetime to the connection's
lifetime. This prevents a class of silly errors where the socket object
isn't freed, or the socket object is assigned to two different
connection objects
Diffstat (limited to 'librabbitmq/amqp.h')
-rw-r--r-- | librabbitmq/amqp.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 7f479c8..704e9fc 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -670,22 +670,6 @@ AMQP_CALL amqp_socket_open(amqp_socket_t *self, const char *host, int port); /** - * Close a socket connection and free resources. - * - * This function closes a socket connection and releases any resources used by - * the object. After calling this function the specified socket should no - * longer be referenced. - * - * \param [in,out] self A socket object. - * - * \return Zero upon success, non-zero otherwise. - */ -AMQP_PUBLIC_FUNCTION -int -AMQP_CALL -amqp_socket_close(amqp_socket_t *self); - -/** * Retrieve an error code for the last socket operation. * * At the time of writing, this interface is not well supported and is subject @@ -716,6 +700,10 @@ int AMQP_CALL amqp_socket_get_sockfd(amqp_socket_t *self); +AMQP_PUBLIC_FUNCTION +amqp_socket_t * +amqp_get_socket(amqp_connection_state_t state); + AMQP_END_DECLS #include <amqp_framing.h> |