Skip to contentSkip to conversation

io: improve docs for QIOChannelSocket async functions

PATCH In review Daniel P. Berrange 2 participants 2 messages Feb 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io: improve docs for QIOChannelSocket async functions

In the docs for qio_channel_socket_connect_async, qio_channel_socket_listen_async and qio_channel_socket_dgram_async, mention that the SocketAddress parameters are copied, so can be freed immediately.

---
 include/io/channel-socket.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
include/io/channel-socket.h +9 -2
index 810537e..70d06b4 100644
@@ -105,7 +105,9 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,
  * Attempt to connect to the address @addr. This method
  * will run in the background so the caller will regain
  * execution control immediately. The function @callback
- * will be invoked on completion or failure.
+ * will be invoked on completion or failure. The @addr
+ * parameter will be copied, so may be freed as soon
+ * as this function returns without waiting for completion.
  */
 void qio_channel_socket_connect_async(QIOChannelSocket *ioc,
                                       SocketAddress *addr,
@@ -140,7 +142,9 @@ int qio_channel_socket_listen_sync(QIOChannelSocket *ioc,
  * Attempt to listen to the address @addr. This method
  * will run in the background so the caller will regain
  * execution control immediately. The function @callback
- * will be invoked on completion or failure.
+ * will be invoked on completion or failure. The @addr
+ * parameter will be copied, so may be freed as soon
+ * as this function returns without waiting for completion.
  */
 void qio_channel_socket_listen_async(QIOChannelSocket *ioc,
                                      SocketAddress *addr,
@@ -181,6 +185,9 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *ioc,
  * This method will run in the background so the caller
  * will regain execution control immediately. The function
  * @callback will be invoked on completion or failure.
+ * The @localAddr and @remoteAddr parameters will be copied,
+ * so may be freed as soon as this function returns without
+ * waiting for completion.
  */
 void qio_channel_socket_dgram_async(QIOChannelSocket *ioc,
                                     SocketAddress *localAddr,
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · * Daniel P. Berrange ([email protected]) wrote:

In the docs for qio_channel_socket_connect_async, qio_channel_socket_listen_async and qio_channel_socket_dgram_async, mention that the SocketAddress parameters are copied, so can be freed immediately.

Thanks,

Quoted 43 lines
---
 include/io/channel-socket.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
include/io/channel-socket.h +9 -2
index 810537e..70d06b4 100644
@@ -105,7 +105,9 @@ int qio_channel_socket_connect_sync(QIOChannelSocket *ioc,
  * Attempt to connect to the address @addr. This method
  * will run in the background so the caller will regain
  * execution control immediately. The function @callback
- * will be invoked on completion or failure.
+ * will be invoked on completion or failure. The @addr
+ * parameter will be copied, so may be freed as soon
+ * as this function returns without waiting for completion.
  */
 void qio_channel_socket_connect_async(QIOChannelSocket *ioc,
                                       SocketAddress *addr,
@@ -140,7 +142,9 @@ int qio_channel_socket_listen_sync(QIOChannelSocket *ioc,
  * Attempt to listen to the address @addr. This method
  * will run in the background so the caller will regain
  * execution control immediately. The function @callback
- * will be invoked on completion or failure.
+ * will be invoked on completion or failure. The @addr
+ * parameter will be copied, so may be freed as soon
+ * as this function returns without waiting for completion.
  */
 void qio_channel_socket_listen_async(QIOChannelSocket *ioc,
                                      SocketAddress *addr,
@@ -181,6 +185,9 @@ int qio_channel_socket_dgram_sync(QIOChannelSocket *ioc,
  * This method will run in the background so the caller
  * will regain execution control immediately. The function
  * @callback will be invoked on completion or failure.
+ * The @localAddr and @remoteAddr parameters will be copied,
+ * so may be freed as soon as this function returns without
+ * waiting for completion.
  */
 void qio_channel_socket_dgram_async(QIOChannelSocket *ioc,
                                     SocketAddress *localAddr,
Signature · 1 line
2.5.0

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK