JohnNash Posted October 24, 2016 Posted October 24, 2016 I've seen some weird behavior in my code (I log almost everything). While 1 $WaitingTime = TimerDiff($wtTimer) sleep(300) $Data = TCPRecv($MainSocket, $MaxLength) _FileWriteLog($LogFolder&"info.log", "Wait for answer that Server is ready for step 21") If $Data = "ByeBye" Then _FileWriteLog($LogFolder&"info.log", "Server tells me to shutdown") Terminate() ElseIf $Data = "Step 20 Finished on Server" Then _FileWriteLog($LogFolder&"info.log", "Server answers it is ready for step 21") ExitLoop ElseIf $WaitingTime>4000 Then _FileWriteLog($LogFolder&"info.log", "No Answer, we still continue" &$Data) ExitLoop EndIf WEnd _FileWriteLog($LogFolder&"info.log", "Left the WhileLoop") And my logs show this: 2016-10-24 00:52:39 : Wait for answer that Server is ready for step 21 2016-10-24 00:52:39 : (Logline from completely different loop) 2016-10-24 00:52:39 : (Logline from completely different loop) 2016-10-24 00:52:39 : (Logline from completely different loop) 2016-10-24 00:52:39 : (Logline from completely different loop) 2016-10-24 00:52:40 : Wait for answer that Server is ready for step 21 2016-10-24 00:52:40 : Server answers it is ready for step 21 How can this happen? (If there was a "Left the Whileloop" log in between I could imagine it could happen... but now? I thought AutoIT was singlethreaded...
Moderators Melba23 Posted October 25, 2016 Moderators Posted October 25, 2016 JohnNash, AutoIt is single-threaded. Do you have some form of _Timer_* or Adlib function running elsewhere in the script? That would allow the loop to be interrupted while still running. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
mikell Posted October 25, 2016 Posted October 25, 2016 21 hours ago, JohnNash said: I log almost everything
JohnNash Posted October 28, 2016 Author Posted October 28, 2016 On 10/25/2016 at 9:51 AM, Melba23 said: JohnNash, AutoIt is single-threaded. Do you have some form of _Timer_* or Adlib function running elsewhere in the script? That would allow the loop to be interrupted while still running. M23 Yes it seems indeed it has something to do with self-made sleep cycles (while ... wend). Also I ran multiple instances of the client by accident.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now