From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 475392C036 for ; Thu, 11 Apr 2019 09:47:04 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rrxcDQv-O9hH for ; Thu, 11 Apr 2019 09:47:04 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 0268F2BFBD for ; Thu, 11 Apr 2019 09:47:03 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH 2/2] swim: expose ping broadcast API References: <8a92b8b538213827ac0ae156263bc88974e320c3.1554918303.git.v.shpilevoy@tarantool.org> <20190411130014.GB2123@chai> From: Vladislav Shpilevoy Message-ID: <284071b3-e0b1-0993-5245-4428a791ddee@tarantool.org> Date: Thu, 11 Apr 2019 16:47:01 +0300 MIME-Version: 1.0 In-Reply-To: <20190411130014.GB2123@chai> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org, Konstantin Osipov On 11/04/2019 16:00, Konstantin Osipov wrote: > * Vladislav Shpilevoy [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 >