Hi Sergey. The frames are just bytes delineated by FFD8 and FFD9. We do have attach headers with Content-Length. I tried both sending headers and images as a single chunk and "first header then image". Both work with old server, but neither with new. Unfortunately I can't send real code, but all it is is an mg_write. Like I said, if I send a single frame (with header) and then return, the browser client displays it just fine. When I send continuous frames, it pukes.
Greg On Friday, August 29, 2014 10:47:30 AM UTC-7, Sergey Lyubka wrote: > > Hi Greg, > you're mentioning frames - what frames are that? > > Are you talking about websocket frames? > If not, do you set specify content length header? > > If you share your code (or high-level pseudo code), that could help too. > > > > On Fri, Aug 29, 2014 at 6:45 PM, gregory kosinovsky <[email protected] > <javascript:>> wrote: > >> 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]> >>> 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]. >>>> 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. >>>> >>> >>> -- >> 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.
