[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUnet-developers] Sending large data

From: Alessio Vanni
Subject: Re: [GNUnet-developers] Sending large data
Date: Thu, 17 Oct 2019 22:52:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Christian Grothoff <address@hidden> writes:

> Segmenting is the right answer. As for 'fast enough', there is usually
> no requirement on how fast you call those APIs. However, for a CADET
> channel, the receiver must call "GNUNET_CADET_receive_done" after each
> message. Until you call that function, you won't get another one. So
> the most likely problem is that you failed to call this function after
> receiving the first segment.

So if I understand correctly, the client can send segments at any speed
and those messages are left "in the air" until the service is ready?  I
don't really know the internal of the MQ API and the manual doesn't
really explain if there are some dark corners.  As for CADET, I didn't
try yet but I assume it works the same way?

> Segmentation is the answer.

In my client, I have something like this (this example is simplified):

send_message(void *data) {
     /* Frobnicate data and segment it */
     for (i=0; i<number_of_segments; ++i) {
          GNUNET_MQ_send(mq, segments[i]);

     /* Maybe do something else like cleanup */

while my service handles it like this (again, simplified):

handle_message(void *cls, struct MyMessage *msg) {
     struct Client *c = cls;

     LOG("received segment %d\n", ntohl(msg->segment));

     /* Maybe do something else with msg */


If I send a single message whose `segment' field is 0, the service
correctly prints "received segment 0".  However, if I send three
messages with `segment' equal to 2, 1 and 0 respectively, the service
will print only "received segment 2" and nothing else.  I really can't
see what the problem could be.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]