http://qs1969.pair.com?node_id=11134679


in reply to Re^5: Adding simple HTTP controls to existing code
in thread Adding simple HTTP controls to existing code

Thanks Huck.

I was able to quickly adapt Tybalt89's suggestion in my code. I will give your suggestion a try as well.

Comparing and contrasting different solutions while learning is always helpful. Thanks again

  • Comment on Re^6: Adding simple HTTP controls to existing code

Replies are listed 'Best First'.
Re^7: Adding simple HTTP controls to existing code
by huck (Prior) on Jul 05, 2021 at 20:00 UTC

    They have a similar base

    Mine does a two step between accept and read, a client CAN create the connection and wait a bit before writing, so mine wont block there. But in general http: clients shouldnt matter.

    His has a better read, the way i commonly use it is a lot like his, but i just collect data, then have another loop that looks for completed lines so i dont block on the \n. IN both of these examples we block on the \n read, mine till \n, his to blank line.

    I added a cmd lookup table for what to execute

    I only look at the first line sent.

    I added the /null command to show you what might happen if you dont send anything back