comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Broadcast / iterate to all Connection objects via Simple Components?
Date: Sun, 19 Feb 2023 09:29:44 +0100	[thread overview]
Message-ID: <tssmlp$bdnn$1@dont-email.me> (raw)
In-Reply-To: <aabea618-3be7-4257-aad7-5fde634c3090n@googlegroups.com>

On 2023-02-19 02:27, A.J. wrote:

> I couldn't get Send() to send more data than Available_To_Send (after calling it, Available_To_Send ended up returning 0, and continued to do so despite wrapping Send() in a loop),

As it must because the outgoing buffer is full. You must save the 
client's state and return (=yield) at this point. When a portion of data 
is sent (taken from the buffer) the client's Sent primitive procedure 
will be called and from there the client can restore its state and 
continue. You cannot loop, it is pointless. You must yield.

This was the essence of the whole discussion about the state machines 
vs. co-routines. Writing clients is *difficult*.

> but increasing the send buffer to 8kb per connection worked fine.

Sure in many cases there exist buffer size that guarantees sending [*]. 
This is not always the case. When not, the client must drop connection 
if it cannot sent. So, you will have unreliably working clients.

--------------------
[*] Many industrial protocols have bounded the packet size and work in a 
query-answer manner. For these the output buffer size is roughly the 
packet size.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2023-02-19  8:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 20:29 Broadcast / iterate to all Connection objects via Simple Components? A.J.
2023-02-08  8:55 ` Dmitry A. Kazakov
2023-02-08  9:55 ` Jeffrey R.Carter
2023-02-13  7:28   ` Emmanuel Briot
2023-02-13  8:30     ` Dmitry A. Kazakov
2023-02-13  8:44       ` Emmanuel Briot
2023-02-13 10:55         ` Dmitry A. Kazakov
2023-02-13 11:07           ` Emmanuel Briot
2023-02-13 11:57             ` Dmitry A. Kazakov
2023-02-13 13:22               ` Niklas Holsti
2023-02-13 15:10                 ` Dmitry A. Kazakov
2023-02-13 16:26                   ` Niklas Holsti
2023-02-13 19:48                     ` Dmitry A. Kazakov
2023-02-15  9:54                       ` Niklas Holsti
2023-02-15 10:57                         ` Dmitry A. Kazakov
2023-02-15 18:37                           ` Niklas Holsti
2023-02-19  1:27                             ` A.J.
2023-02-19  8:29                               ` Dmitry A. Kazakov [this message]
2023-02-19 14:37                               ` Niklas Holsti
2023-02-13 15:43                 ` J-P. Rosen
2023-02-13 16:40             ` Jeremy Grosser <jeremy@synack.me>
2023-02-13 20:33 ` Daniel Norte de Moraes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox