[tarantool-patches] Re: [PATCH 2/2] swim: expose ping broadcast API
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Apr 11 16:47:01 MSK 2019
On 11/04/2019 16:00, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/04/10 21:01]:
>> +/**
>> + * Broadcast a ping to all interfaces on a specified @a port. If
>> + * @a port is < 0, then a port of the SWIM instance is used.
>> + */
>
> Please add to the comment information about possible errors -
> memory allocation error or there are no interfaces available for
> broadcast. Mention what errors are not detected since the
> broadcast itself happens asynchronously - errors related to
> writing to network, these are simply ignored.
Updated the comment:
===================================================================
diff --git a/src/lib/swim/swim.h b/src/lib/swim/swim.h
index 60f5a8a1d..c4026f477 100644
--- a/src/lib/swim/swim.h
+++ b/src/lib/swim/swim.h
@@ -137,8 +137,17 @@ int
swim_probe_member(struct swim *swim, const char *uri);
/**
- * Broadcast a ping to all interfaces on a specified @a port. If
- * @a port is < 0, then a port of the SWIM instance is used.
+ * Broadcast a ping to all interfaces supporting IPv4 with a
+ * specified @a port.
+ * @param swim SWIM instance to broadcast from.
+ * @param port Port to send to. If < 0, then the current port of
+ * @a swim is used.
+ *
+ * @retval 0 Success. The broadcast packet was scheduled and at
+ * least one suitable interface was detected. But it does
+ * not mean, that the packet will be sent successfully.
+ * @retval -1 Error. OOM, or there was not found an interface,
+ * supporting IPv4.
*/
int
swim_broadcast(struct swim *swim, int port);
===================================================================
>
>> +int
>> +swim_broadcast(struct swim *swim, int port);
>
>
> --
> Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
> http://tarantool.io - www.twitter.com/kostja_osipov
>
More information about the Tarantool-patches
mailing list