Activity for John D Charlton

  • John D Charlton John D Charlton posted a comment on discussion Open Discussion

    I don't have an example, but it should work to open the connection first and close it at the end when finished. In the loop do read and display the output. If your goal is to have 1 sec output you should set a timer event for 1sec to update the output. Here is an example of a timer thread but you can do your own google search to find other examples: https://stackoverflow.com/questions/9413656/how-to-use-timer-class-to-call-a-method-do-something-reset-timer-repeat?newreg=0d9fcf1d977f487f8c72bc2ee...

  • John D Charlton John D Charlton posted a comment on discussion Open Discussion

    You can try to reduce your sleep time so that the read operation is able to work more frequently. As long as you have some sleep time in the loop it will prevent it from spinning and using up all of the processor time. Also you probably want to open the TCP socket in a separate method and leave it open for the duration rather than reconnecting every second. That is probably where all the extra time is going. John

1