Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
carlschneider Senior Member Joined: 04/08/2023 Location: South AfricaPosts: 158
Posted: 08:55pm 10 Sep 2023
Copy link to clipboard
Print this post
Here's to hoping somebody can please clarify.
In the Webmite Manual v3 for the
WEB TCP READ cb%, buff%()
it states that
If there is data that has been received then the BASIC program must respond with one of the WEB TRANSMIT commands in order to respond and close the connection.
In my use case there is no WEB TRANSMIT FILE cb%, filename$, content-type$ option where content-type$ is "text/json".
I have instead used WEB TCP SEND a%, buffer%() WEB CLOSE TCP CLIENT a%
where buffer%() has the following headers and is correctly assembled, sent, received and processed by the requesting page.
HTTP/1.1 200 OK Content-type:text/json Connection: keep-alive Content-length:...etc
Does the above code fulfil the WEB TCP READ requirement to respond and close the connection? It works for me but the web server does get lost when there is high traffic.Cheers Carl Retirement is tough on Hobbies without a day job