Hi ConceptMan,
sorry I was originally looking at the wrong section of the script! The basics of the script look ok; the TCP socket properties are being defined before use, etc...
although page level functions will work, I follow other members suggestions with respect to functions and place them on the activity script level so that they are always available regardless of what page you have navigated to. As soon as you navigate away from a page, it's technically unloaded and none of it's functions or variables are available.
The socket is being closed, but it sounds and looks like when you are re-entering the page the Pronto is trying to re-use the pre-existing socket. If memory serves, I don't think Prontoscript allows for re-using the socket.
if my above assumption is correct (I can guarantee another member will chime in!): You need to re-initialize both the socket and any properties associated with it (onData, OnConnect, etc...) after each socket.close. Although it doesn't exactly dispose of the old objects, you are technically overwriting them and as such re-init'ing all of the properties.
most people will create an additional function to 're-init' the socket and all of its properties. Thus each time the connection is closed you would want to re-init the socket and all its properties; otherwise you might end up getting a 'object x has no properties assigned to it' or something a little more cryptic.
Hope this gives you some useful info! Cheers // Jason
PS: Does it spit out a specific IO error message?
Edit: If you are using the 'back' button to navigate back to the page with the script on it, the page script may not be executed. I'm not 100% sure on this one, but try navigating to the page using something else other than the 'previous page' option. This should guarantee that the page script is being executed!
Last edited by GuerillaBuild
on January 25, 2009 15:17.