Question re: HTML served by Micromite
| Author | Message | ||||
MicroBlocks![]() Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
The problem is not with the HTML. It has more to do with the HTTP protocol and the underlying TCP protocol. HTTP uses a header "content-length" to tell the receiving end how many bytes of data to expect. After this the connection can be closed. For dynamically created content you will not know at the time the headers are send how long the data stream will be. You just stream the data and at the end you close the connection on the server side. Best to wait a little while as it can be possible that the closing command will terminate the last data block. This is a brute force method not the recommended way. A better solutions (if possible) is to do a 'half close' on the tcp connection. You close the output and then wait until the receiver also closes it output. Then you close it fully. This can only work when you have access to the tcp connection. Even then you should have a timeout so that if the receiver does not close its side, you still brute force close your side fully. For all the detail about http see: http://www.w3.org/Protocols/rfc2616/rfc2616.txt It is also good practice to include a doctype as it forces the best rendering mode on browsers in this example it is HTML5: [code] <!DOCTYPE html> <html> <head> .. </head> <body> ... </body> </html> [/code] Microblocks. Build with logic. |
||||