Question re: HTML served by Micromite


Author Message
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:53pm 28 Apr 2017      

"Connection:close" header is normally send from the browser.
In modern browsers it is always "Connection:Keep-Alive" and under HTTP 1.1 it is also the default. It is the client that should disconnect.

How a close can be done through ser2net i don't know as i never used it.
It might work by close the serial port on the micromite side.
Maybe the ser2net docs has something about it, but i think the ser2net is also built with the idea that the client controls the opening/closing of the tcp connection.

Just reading about ser2net it seems to just be a proxy between tcp and a serial port. It is transparent to the data that is being send. So all the headers that are send will be ignored by ser2net. In the case a webserver is used, you have more control over the connection, with ser2net i suspect you have none on the 'server' side.

It is open source thought so you might be able to adapt the code to inspect the data coming from the serial port for a special character or escape sequence to close the tcp connection.
Microblocks. Build with logic.