From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Broadcast / iterate to all Connection objects via Simple Components? Date: Mon, 13 Feb 2023 09:30:22 +0100 Organization: A noiseless patient Spider Message-ID: References: <392dd5d3-4df1-403f-b703-ee6f750dbc81n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 13 Feb 2023 08:30:22 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="0a446d501ac53ea3fdfc7027a586d37f"; logging-data="2208201"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fOBzuzoWpMjL+TkiRoPsxlK2WzkeyOLc=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Cancel-Lock: sha1:vujDAdBAOkraCr2ML7Cf6XnFg3Q= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64909 List-Id: On 2023-02-13 08:28, Emmanuel Briot wrote: > I am not sure how familiar you are with Network programming in general (not just as it would be done in Ada). > Using a blocking Send could actually kill your performance. [...] > A similar approach when receiving messages from clients, by the way. The message might have sent only part of its message, so you > need to give up temporarily, and come back to it when poll tells you there is something new to read. Yes. All networking in Simple components is built on non-blocking sockets (socket select). P.S. This poses difficulties for users, who see all communication turned upside down being driven by arbitrary socket events rather than by the protocol logic. This was a reason I argued for introducing co-routines with task interface in Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de