Hi Sergey. The main problem I am trying to overcome is that the server does appear to block when multiple frames are sent to the server. If I return after sending a single frame, a client receives and displays that frame. However, if I send multiple frames, client gets nothing. I am just using mg_write -- which is what I used with the old version of the server without a problem. Using mg_send and mg_send_data has the same behavior.
Greg On Thursday, August 28, 2014 11:02:26 PM UTC-7, Sergey Lyubka wrote: > > Hi Gregory! > I believe you're talking about mg_send_data() function, not mg_send(). > mg_send() returns either 0 or the 3rd parameter, number of bytes > mg_send_data() returns the size of output IO buffer. > > Both functions do not send data to the socket. mg_printf() and > mg_printf_data() are the same in this respect by the way. > > These functions only append the data to the output buffer, and mongoose > sends that data later on. That is by design, and the reason is that these > functions must not block the execution. Mongoose is asynchronous and > non-blocking. > > Hope that helps. > > > On Fri, Aug 29, 2014 at 2:15 AM, gregory kosinovsky <[email protected] > <javascript:>> wrote: > >> It appears that the problem I saw earlier comes from the fact that -- for >> multiple calls to mg_write -- the last return value reflects the SUM of all >> previously written sizes. This indicates that the server is not sending the >> data as it arrives, but is buffering it. What would be the cause of such >> behavior and how would this be fixed? >> >> Thank you, >> >> Greg >> >> -- >> You received this message because you are subscribed to the Google Groups >> "mongoose-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/mongoose-users. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "mongoose-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mongoose-users. For more options, visit https://groups.google.com/d/optout.
