Akarillon Posted December 9, 2011 Posted December 9, 2011 (edited) Is it possible to make 1 script receive information from 2 different sources via TCPRecv at the same time? And if it is, how? Or maybe I have to make a queue, like having the second computer wait until the first is completed? At the moment I am using a Do loop on 1 TCPAccept token. Do $KlientRecv1 = TCPRecv($TCPAccept, 2048) Until $KlientRecv1 <> "" GUICtrlSetData($Input1x, $KlientRecv1) _WriteToLog(GuiCtrlRead($Label1), $KlientRecv1) Can post code if necessary. Edited December 9, 2011 by Akarillon Challenge accepted!
Mikeman27294 Posted December 9, 2011 Posted December 9, 2011 (edited) Not without multi-threading. It was noted in another forum *I meant thread*, that if you know the command-line command to recieve the information, you could do so, both at the same time. Edited December 9, 2011 by Mikeman27294
Akarillon Posted December 9, 2011 Author Posted December 9, 2011 understanding more and more every day.. thanks Challenge accepted!
water Posted December 9, 2011 Posted December 9, 2011 (edited) TCPListen allows to specify a queue length for pending connections (and has a reasonable default value). So you can't handle two connections at the same time but one after the other. Give it a try. Edited December 9, 2011 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Akarillon Posted December 9, 2011 Author Posted December 9, 2011 TCPListen allows to specify a queue length for pending connections (and has a resonable default value). So you can't handle two connections at the same time but one after the other. Give it a try.Ye, that was my plan B Plan C would be several executables. Challenge accepted!
water Posted December 9, 2011 Posted December 9, 2011 Why do you want to process connections in parallel or run several executables? Do you have so many clients connecting at the same time? Or does processing the pakets take so much time that it would block other connections for too long? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Akarillon Posted December 9, 2011 Author Posted December 9, 2011 Why do you want to process connections in parallel or run several executables? Do you have so many clients connecting at the same time? Or does processing the pakets take so much time that it would block other connections for too long?I was planning on using this as an Inventory-software that receives information about computers every day at 6 o'clock exactly from over 400 computers..Thought it would take forever to make a queue of them all Challenge accepted!
water Posted December 9, 2011 Posted December 9, 2011 My understanding is that the queue is handled by the TCP stack itself. You listen on the socket, take the incoming data and process it. Then you receive the next paket, process it and so on. The pakets arriving during your processing of another clients data is queued by TCP. If the queue overflows you raise the number in TCPListen. Or you can extract the processing of the data into a separate AutoIt script, compile it and use Run to process the data. This way you can run multiple "processing" exe's in parallel. This depends on how your inventory system (database ...?) can handle parallel data input. If you need to send some feedback to the client when done it gets a bit more complex. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Akarillon Posted December 9, 2011 Author Posted December 9, 2011 My understanding is that the queue is handled by the TCP stack itself. You listen on the socket, take the incoming data and process it. Then you receive the next paket, process it and so on. The pakets arriving during your processing of another clients data is queued by TCP.If the queue overflows you raise the number in TCPListen.Or you can extract the processing of the data into a separate AutoIt script, compile it and use Run to process the data. This way you can run multiple "processing" exe's in parallel. This depends on how your inventory system (database ...?) can handle parallel data input. If you need to send some feedback to the client when done it gets a bit more complex.I think I'll stay on the easy part of programming for the moment Can the TCPListen handle incoming connections even if the script is occupied in a do-loop? Challenge accepted!
water Posted December 9, 2011 Posted December 9, 2011 Yes, that's what the queue is for. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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