Timeline for Is it possible to accept multiple web requests at once?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 3, 2015 at 9:59 | vote | accept | William Hilsum | ||
Aug 13, 2015 at 15:13 | comment | added | TheDoctor | The official Ethernet Shield advertises ability to run 4 simultaneous sockets... | |
Aug 12, 2015 at 20:37 | comment | added | Nick Gammon♦ |
it needs to operate a solenoid for ~2 seconds which ... means that it stops listening for new requests - as the other comments point out you just need to restructure. Turn the solenoid on, remember when you did that, and check in the loop which is listening for new requests if the time is up to turn it off again.
|
|
Aug 12, 2015 at 16:28 | comment | added | Pandemonium |
Not sure if it will work for your case, but you can try using interrupt to quickly jump to some signal and back to your main loop. This is similar to concurrency in a web server, since Arduino cannot run things in parallel.
|
|
Aug 12, 2015 at 12:11 | answer | added | neuhaus | timeline score: 2 | |
Aug 12, 2015 at 10:29 | comment | added | Majenko |
Then you need to start with the basics. Look at the BlinkWithoutDelay example to see how to write non-blocking code. I'll bet your sketch is littered with delay() calls. There is no place for delay() in a proper program, except for tiny (a millisecond or so) delays for timing purposes. Also, get to grips with the concept of the Finite State Machine (there are many resources and tutorials online).
|
|
Aug 12, 2015 at 8:43 | comment | added | William Hilsum | @NickGammon - it needs to operate a solenoid for ~2 seconds which doing inline in the http request code means that it stops listening for new requests. | |
Aug 12, 2015 at 1:17 | comment | added | Nick Gammon♦ | What sort of action would it be busy doing? Generally I would expect the server to decode the HTTP request almost instantly, and then do the action (eg. return some data). Is your setup such that this might take some time? | |
Aug 12, 2015 at 0:53 | review | First posts | |||
Aug 13, 2015 at 15:13 | |||||
Aug 12, 2015 at 0:52 | history | asked | William Hilsum | CC BY-SA 3.0 |