I wonder if anyone can help. I am writing an application to a Linn Kivor, and I want to download all of the album and track information to the Pronto to allow me to scroll through all of my albums.
At the moment, the only way that I can talk to the server is using a Sync socket on the Pronto but this obviously locks the device while this is operation. When I use a for next loop to run through approx 700 albums, the most that I can download is about 500 before the for-next loop times out.
What I would really like to do is to use an Async socket to talk to the Kivor, but I cannot seem to get any response when I try Async. I suspect that the Kivor is not closing the socket after responding, but even trying to force the socket closed does not have the desired effect.
The code I am using for Sync socket is shown below. The Kivor will always send a '~' at the end of a message so I have tried looking for this on the incoming string and then closing the socket based on this, but this does not seem to work.
I am new to Javascript, so any advice would be gratefully received.
Many thanks.
------------------------
...... if (message_counter==62) message_counter=0; else; message_counter++; var socket = new TCPSocket(true); socket.connect('192.168.1.100', 6789, 3000); var message_out = "#pronto#@"+zone+"@"+message_number[message_counter]+msg+"~"; get_checksum(message_out); socket.write(message_out+checksum+"\r\n"); var output = socket.read(500,200); socket.close(); full_output[0]=output; System.delay(150); ...... ------------------------