EthernetInterface Webserver fragmenting large files ...

29 Jun 2013

Hi,

I'm currently building a Webserver. I started from the httpserver_echoback "Hello world" program.

Now I encounter a problem that keeps me puzzled. My small html files have no trouble being send in one TCP packet, and are therefore received flawlessly by various by the http clients (tested with chrome, firefox, android ...) .

However the larger files eg. bitmaps, jpegs aren't received correctly. I'm quite sure that I am to blame :-(

I know the larger files have to be fragmented before they are send trough the interface, but I was kinda hoping the EthernetInterface library was taking care of that for me since I saw a member function send and send_all. Seems this is not the case.

Now I'm wondering ... What is the difference between send and send_all member functions? Is there some cool newbie enabling "Hello World" example on how to handle the fragmentation? How do I know my data is being acknowledged?

Thanks in advance.

KK

29 Jun 2013

Hello Koen,

perhaps you could provide a piece of code? I'm working on the same matter, but at least my files get delivered (but it might be a difference between your definition of "big files" and mine :-)

I used Greg Steiert's code as a start and modified it for my purposes: https://mbed.org/users/gsteiert/code/HTTPDcgi/

Perhaps you could try this. When I'm generating a request my code generates the html-code and sends it to the requesting browser. This works so far, although I see that data is delivered in smaller parts (I don't know to avoid this yet, but I'm happy to have it working so far...)

Michael