Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:40 27 Nov 2024 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : WEB TCP READ usage query

Author Message
carlschneider
Senior Member

Joined: 04/08/2023
Location: South Africa
Posts: 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
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024