I am trying to write an app which:
-
Gets GPS data (done)
-
Connects to a TCP server (done)
-
waits for incoming strings from this server (not done right yet)
-
Runs a Timer which every 60 seconds transmits the GPS data to same TCP server using socket.send(Does not work)
Because the socket.receive blocks, the Timer event is not executed.
I am a Delphi Pascal programmer. In Delphi, I would have to set up a separate Thread to be able to write to the TCP server, while at the same time waiting for a blocking Read.
How do I do this in Corona Lua?
I would also really appreciate any example code to do this properly.
Thanks, Bart