Timeline
May 1, 2014:
- 11:33 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- I agrre that my TCPConnect timeout solution must be committed I will speak with Jon which is the only one which can commit for AutoIt change
- 10:58 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Too bad that don't work for connected WEB BROWSER clients. 3.3.10.2 STILL can't detect 10054 and MUST rely on other means to detect the error when a client connects to the server with a WEB BROWSER! Even then the error is 10053 (PROTOCOL ERROR) and not a TIMEOUT because the socket is long closed on client side before any kind of time out (On client side) can occur. I say it again! 3.3.10.2 CAN NOT detect 10054 when a web browser like CHROME OR anything else connects to the server... The last two above scripts are the PROOF of it...! (comment 30 31 should be enough to proof that 3.3.10.2 TCPRecv @error detection is BROKEN when detecting client side closed browser sockets where 3.3.8.1 had no problems what soever!) Thank you for your time.
- 7:53 PM Ticket #2690 (Win..... Return Value Proposal.) updated by
- jpm I understood your statement. However, perhaps my post was an understood differently than I wanted. I'll be back over the weekend to this topic.
- 3:55 PM Milestone 3.3.11.5 completed
- 3:26 PM Ticket #2648 (FileSaveDialog extension value) closed by
- Fixed: Fixed by revision [10093] in version: 3.3.11.5
- 8:26 AM Ticket #2700 (_GUICtrlRichEdit_SetCharBkColor()) closed by
- Fixed: Fixed by revision [10091] in version: 3.3.11.5
Apr 30, 2014:
- 8:41 PM Ticket #2700 (_GUICtrlRichEdit_SetCharBkColor()) updated by
- sorry I forgot REPRO: […]
- 8:23 PM Ticket #2700 (_GUICtrlRichEdit_SetCharBkColor()) created by
- from HelpFile: […] here is a solution to the UDF: […] And …
- 6:02 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Can you switch the discussion to Forum as too may post for a track report. For me the uploaded version for solving the TCPConnect timeout and clarification of @error is enough to have a good handling of peer disconnection as @error is set to 10054 which exactly what MSDN is describing WSAECONNRESET = 10054 Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
- 8:35 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Whoops sorry, that one before this one got messed up somehow... This one should do better. […]
- 8:28 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- For the sake of clarity, this is a working example of 3.3.8.1 with proper @error detection set for the installation of genuine Autoit3 v3.3.8.1 and modified to remove server response to lesson the confusion. When executed with 3.3.8.1 the script will close the socket as expected. When executed with any other script greater than this version problems may arise! Newer version require the comments to be removed, and @error detection be > 0... And I believe without any further testing that this is the root difference between diegomainster's working examples and my failing examples.(Not tested elsewhere except the recent reproduction scripts). Thank you all for helping me understand the new TCPRecv function. Still don't care to add TimerInit, i'll stay with 3.3.8.1 for TCP related scripts until it is more user friendly(if ever). Please update the example 'help' scripts for TCPRecv to reflect these changes if you had not already, or aren't planing to do so. (They are amazing and taught me everything I know, thank you for that) TCPStartup() $serversock = TCPListen('127.0.0.1', 81) If @error Then Exit ; we know this one. While 1TCPRecv Do $hi = TCPAccept($serversock) If @error Then Exit ; we know this one. Until $hi <> -1 MsgBox(0,"Connected","A client has connected...") $ti = TimerInit() While 1 TCPRecv($hi,1500) If @error Then MsgBox(0,"Closed","Closing the connection: " & @error) TCPCloseSocket($hi) ExitLoop EndIf #cs If TimerDiff($ti) > 99 Then TCPSend($hi, 'data') If @error Then MsgBox(0,"SEND ERROR!",@error) $ti = TimerInit() EndIf #ce WEnd WEnd
- 8:07 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- In 3.3.8.1 it is even simpler than i describe it.. All you need is an @error of any kind to close the client side socket. Newer versions require you to ignore @error -1 plus do a timer init delay before sending data. (If I understand correctly)
- 7:17 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Replying to diegomainster@…: > Now I understand the problem you described, and me using your code also happened in version 3.3.8.1. I also tested the scripts with both versions. And 3.3.8.1 did not reflect the same problems as newer versions. I will assume that when you ran your scripts that @error was still set to > 0. (Easy miscalculation to do and would not hold it against a master coder like you or anyone else to oversee, I have done it countless times) But I realize assumptions are often misleading and am willing to diagnose why my version of 3.3.8.1 worked when @errror level is set properly for the version that is installed, when yours did not. 3.3.8.1 requires @error of any kind in order to close the socket.(Wow that is easy!) Later versions seem to require an error > 0... Or oven perhaps less than -1... definitely not an @error of -1 whatever you do. (@error -1 is worthless, and same as blank, why do we need two?) Later version also seem to require some kind of delay witch TCPRecv never ever ever needed before. TimerInit seems to be the main root of why my scripts fail and your scripts succeed.(Best guess so far) Bottom line: Version 3.3.8.1 - When I tested did not require a TCPsend nor TimirInit delay, in oder to close the socket. Later versions - Seem to require TimirInit before a response/closing. (Which is confusing but i'm ok with as long as there is proper documentation on how to implement the function because Autoit3 is great and should be available to use for everyone, not just elites. And that is what they have done to the best of their ability so far, and I'd hate to say that TCPRecv is not user friendly when it is possibly the most common used function of all time) Once again I appreciate your patients in dealing with a guy like me who is a newbie to forums and coding, Autoit3 has been good to me for a long time and it upsets me that something I have been using for years no longer works the way I expected. Now come on lets be honest please, which would you prefer... 3.3.8.1 needs no further action other than @error -1 to close a socket... Later versions require a time delay, plus you got to ignore @error -1 because it is...??? uhh... Blank i guess, same as the return value? -1 = "" ok.... @error > 0 close socket... Oh plus developers got to make new example scripts to help newbies to learn. (Not that hard, but wow, 3.3.8.1 TCPRecv was so much more user friendlier) You tell me which is not going to confuse the heck out of somebody who is learning TCPRecv. 3.3.8.1 @error -1 CLOSE THE SOCKET (DONE) 3.3.10.2 @error > 0 CLOSE THE SOCKET (OOOPS you forgot the time delay! TRY AGAIN!!!) Not trying to be disrespectful just trying to make a point. Sorry for the offence if any. My overall goal is to help Autoit3 be the best it can be, and they probably are doing a great job without me, but the TCPRecv is my lively hood and means a lot to me. I have no problem staying with 3.3.8.1 for the rest of my days if that is all I can get to work for TCPRecv heavy scripts. Thank you for your time. I still love Autoit3, and they still deserve all the donations they can and will get.
- 5:25 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Now I understand the problem you described, and me using your code also happened in version 3.3.8.1. I realized that if you call TCPSend() sometimes, TCPRecv() detects the closing of the connection, as in the code below: […] So, there is even a problem with TCP in autoit.
- 2:42 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry but this is driving me NUTS! I'm sorry for spamming your forum. If there is no TCPRecv error then why the holy molly is it so hard to work with now? Why in gods name is this not working???? When diegomainster example server/client scripts can detect the error without a problem? I concede that it is probably my scripting but what the heck happened that made TCPRecv so hard to deal with now?!? What in the world am I doing wrong? If you can explain this to me that would be great, in the meantime i'll search for a new place to research this. When I run this script and open a web browser and goto the address and then close the browser the script does not detect @error > 0 !!! Please explain to me if TCPRecv is not bugged, what in the WORLD am I doing wrong here? […]
- 12:57 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry miss spoke again. I can receive the message, just can't detect the @error > 0 in order to close the socket. Sorry for wasting your time.
- 12:57 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry miss spoke again. I can receive the message, just can't detect the @error > 0 in order to close the socket. Sorry for wasting your time.
- 12:50 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- I've done everything I know of to try and make your solution work without any success at all. I've tested it on three different operating systems and still nothing. I'm very confused at this point why @error > 0 will work for you when I can't even get a received message most of the time using that. Guess i'm SOL. If you have any last suggestions or ideas on what I need to fix in the reproduction script then please share them. I don't want to be stuck on 3.3.8.1 forever and am very curious as to what i'm doing differently that it will work for you and not me. I've tried everything I can think of and am ready to concede the subject and just live with what I've got. Thanks.
Apr 29, 2014:
- 11:36 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- I created a video to demonstrate it on my web server when the browser closes the connection, the connection is closed, don't "stays open forever": https://www.youtube.com/watch?v=_s0KJGPtXgw
- 4:56 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Ran tests on a different operating system and it confirmed that TCPRcv still can not detect a client side closed web browser socket as older versions did. I tried the @error > 0 solution and still was unable to detect the client side closed web browser socket via @error 10054. Socket stays open forever even when the browser is closed. Something is off there and it is killing autoit3's ability to function efficiently as a web server. Even worse try mixing the two together as a script that can do web serving and accept persistent autoit3 client connections. Can be done but 3.3.8.1. will out speed any newer version scripts at the same time be more reliable. If you wish to continue thinking there is nothing wrong with TCPRecv then fine i'm ok with that. Future autoit3 users should be aware that scripting a web server with the newer versions wont be as effective. 3.3.8.1 will dominate over newer scripts with speed and rely ability. You might as well retire any thought of having a descent web servers using autoit3 for here on out if the issue is not resolved. Good luck.
- 10:03 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry for junking things up, just wanted to let it be known that the extra TCP connections were obviously something my browser was doing and was able to fix it by turning off a setting. (Just never seen that before and was confusing me)... That issue has nothing to do with autoit3 and i'm sorry for bringing that up. If you need more insight on the @error for new versions then i'd have to make a video of exactly what i'm experiencing over here to show you, if the new repro script does not help at all. Thanks for your time.
- 8:01 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry I was afraid you were going to close the ticket before I could finsih... Here is the reproduction script. Well here it is, hope it helps. Remember the only way to reproduce the error that I know of is two use un-install and re-install between 3.3.8.1 and 3.3.10.2 This also creates a junk file to quickly simulate outgoing requests. Hope that is ok. […]
- 7:51 AM Ticket #2699 (_ArrayAdd $hDataType not documented) closed by
- Fixed: Fixed by revision [10084] in version: 3.3.11.5
- 7:43 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Would you like to see my repro script?
- 7:42 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry it is not working fine, I have tested all day and it is still not as good as old versions…
- 7:41 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Replying to diegomainster@…: > Hello, I created this ticket, once I started ignoring @error = -1, my server is running fine, I'm using version 3.3.10.2, created these 2 scripts to demonstrate how do I detect when the client or server closes the connection, it works for me: > > Server: http://pastebin.com/JPf3A8KE > Client: http://pastebin.com/irVGLpde Thank you for the examples. I'm glad that is working for you. This does not work for what i'm doing. The only difference I can tell here is that i'm not using a Autoit3 client side version to connect to the server. (Don't know why that matters.) Same problem, Autoit3 server can't tell when client web browser closes the socket where older versions could. I'm trying to get an example script working that will show case exactly what is happening between version 3.3.8.1 and the newer version 3.3.10.2 that will hopefully not make things even more confusing. This is what i have learned so far. Autoit3 v3.3.8.1 installed by using the setup download. Works as expected... Autoit3 v3.3.10.2 installed by using the setup download. @error -1 is different, and causes problems when detecting a web browser closed socket. > 0 @error does not help here for whatever reason. Installing the beta version.exe did not seem to help. HOWEVER. When using the beta version on 3.3.8.1 there does not seem to be the problem that genuine 3.3.10.2 installs seem to have.(This was very confusing to me when making the trouble shooting script because I was assuming that it would not work.) So unless you know a better way then I would recommend using the setup installers for switching between autoit3 versions. Uninstall-reinstall between 3.3.8.1 and 3.3.10.2 and then run the bellow repro script. HOWEVER! This too cause me problems! But I do not want to get into detail about it other than to warn you that when I was installing between versions that version 3.3.8.1 was acting out of character and I had to download a fresh copy of the 3.3.8.1 to correct it. (Was getting extra TCP connections to the server that sent no data but would eventually close) Before I was just swapping out exe files between beta and 3.3.8.1 when making this script, but the problem does not seem to start until you install the genuine 3.3.10.2 and then try swapping out with the beta version.
- 7:40 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Many thanks, Now I understand better (I think ?) If the connection is closed by the other side you received in 3.3.8.1 -1 now with my TCPConnect implementation you received 10054 which means connection reset by peer which is better as the @error less than 0 can set in other situation I Think you can agree that my TCPConnect() timeout solution is working fine as 3.3.8.1 Cheers Jpm
Apr 28, 2014:
- 9:40 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Hello, I created this ticket, once I started ignoring @error = -1, my server is running fine, I'm using version 3.3.10.2, created these 2 scripts to demonstrate how do I detect when the client or server closes the connection, it works for me: Server: http://pastebin.com/JPf3A8KE Client: http://pastebin.com/irVGLpde
- 8:57 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- The repro script was the one posted in the forum, no change in the logic. THe intend version does not intend to change any of previous except implemenation of the TCPConnect timeout. I am not a specialist of this net function. so please an update of the last post repro script so I can understand what should help. Perhaps you need 2 script one for the server and the other for the client. Thanks for your cooperation
- 5:21 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- First time running the script get @error 10060 then counts @error -1 forever. All attempts after that show no errors. Only errors right after I switch .exe files from older to newer. Looks like this script is emulating a browser request. You probably already know this but just for the sake of clarity, this problem is most dominant when the script acts like a server and is trying to satisfy the client browser's request. When the request is satisfied the client normally closes the socket. This is where @error -1 was super handy in older versions of TCPRecv, allowing the server to acknowledge the closed socket on it's own end. Newer versions of TCPRecv seem to be vastly compromised because of the new @error levels. Also TCPStartup() never ever shuts down unless the server is deactivated (in my script). It looked like the repo script was constantly starting and stopping. (Don't know if that matters)
- 4:13 PM Ticket #2699 (_ArrayAdd $hDataType not documented) created by
- no documentation to 6 parametr ($hDataType)
- 4:07 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Sorry, I forget to upload your repro script a liitle bit modified #2596 TCPRecv @error.au3 try with this new upload and you will see I think the TCPConnect() error
- 3:32 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Not exactly sure what i'm suppose to do with that. But this is what I did. Installed the beta version you have there, then ran the repro script and this is what it came out with. getting info -> @error = -3 @extended = 3
- 11:04 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- If you use the repro script I uploaded does the error occured on the TCPConnect() not on the TCPRecv()?
- 10:00 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- If I understand what I'm reading then this code should work to detect client side closed sockets but my tests say that the beta still can't detect client side closed sockets. Downloaded the beta .exe from the link and updated my old exe. Problem returns just as I remember it. Sorry... I can't think of any other solutions but to revert back to the older version. This is what i'm using. […] Thank you for your time.
Apr 27, 2014:
- 6:26 PM Ticket #2698 (_ArrayAdd return wrong index) updated by
- Thanks - fixed. M23
- 6:26 PM Ticket #2698 (_ArrayAdd return wrong index) updated by
- Thanks - fixed. M23
- 6:25 PM Ticket #2698 (_ArrayAdd return wrong index) closed by
- Fixed: Fixed by revision [10082] in version: 3.3.11.5
- 3:07 PM Ticket #2698 (_ArrayAdd return wrong index) created by
- I help file for this functions said that Success: the index of last …
Apr 26, 2014:
- 9:27 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- When I try to add the TCPConnect timeout I found that the @error set -1 for different case. SO I modify the @error to identify uniquely the error. In your case I main error come frome the fact that TCPConnect return timeout When the error occurs You can find an updated version of Autoit3.exe at http://www.autoitscript.com/autoit3/devs/jpm/#2384_UDPTCP_@error/ The .txt describe the change in @error Just play with and report any comments Thanks for your cooperation Jpm
Apr 25, 2014:
- 9:36 AM Ticket #2696 (StringRegExp* return non-participating groups) updated by
- As a clue to help locate the failling logic, here's the demonstration that non-participating groups placed after all capturing groups don't cause the ghost capture bug. Only those appearing before or in between capturing groups trigger the issue. […]
Apr 24, 2014:
- 6:38 PM Ticket #2612 (Au3Check bugs on function reference when function takes byref parameter) closed by
- Fixed: Fixed by revision [10077] in version: 3.3.11.5
- 6:04 PM Ticket #2612 (Au3Check bugs on function reference when function takes byref parameter) updated by
- I made a note of that in my first post. I look at that solution as a temporary workaround.
- 3:36 PM Ticket #2612 (Au3Check bugs on function reference when function takes byref parameter) updated by
- If You declare the function before no error …
- 3:35 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Ignoring @error -1 does not make TCPRecv mimic v3.3.8.1. It is still less effective than the genuine TCPRecv version 3.3.8.1. (Can't detect client side closed sockets is the nasty issue) I've tested ignoreing -1 @errors and whatever errors are left can't detect closed client side sockets. This is very bad for servers that respond to web browser requests.
- 9:17 AM Ticket #2697 ("$GW_ENABLEDPOPUP = 6" is missing in "WinAPIConstants.au3") closed by
- Fixed: Fixed by revision [10075] in version: 3.3.11.5
Apr 23, 2014:
- 11:38 PM Ticket #2697 ("$GW_ENABLEDPOPUP = 6" is missing in "WinAPIConstants.au3") created by
- MSDN specifies: GW_ENABLEDPOPUP = 6 The retrieved handle identifies …
- 10:40 PM Ticket #2696 (StringRegExp* return non-participating groups) updated by
- BTW the same effect occurs with groups having repetition count {0} for instance: Pattern: […] Subject: […] In this case RegexBuddy clearly shows the non-participating groups when using full detail mode: Result: […]
- 10:12 PM Ticket #2696 (StringRegExp* return non-participating groups) created by
- Non-participating groups appear as part of the result of our PCRE …
Apr 22, 2014:
- 2:47 AM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- TCPRecv is horribly degraded by new update version. Setting @ERROR for blank returns has no practical use as far as I can tell, and only harms the process. TCPRecv needs to be able to detect client side closed sockets as older versions of TCPRecv were able to do. Don't know why @error -1 is set for blank returns and if it needs to be that way then fine, (have no idea why), but please let there be some kind of error setting that can detect client side closed sockets. @error -1 for detecting client side closed sockets was invaluable to TCPRecv heavy scripts and I can not use newer versions of Autoit3 in those scripts because the older TCPRecv is many times over more efficient than the newer versions.
Apr 21, 2014:
- 11:49 AM Ticket #2695 (For ... in ... next loop modifying items) created by
- Would be cool to be able to modify items in a for each loop. …
- 10:38 AM Ticket #2612 (Au3Check bugs on function reference when function takes byref parameter) updated by
- […]
Apr 18, 2014:
- 11:24 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- Is it possible to revert this behavior back to the v3.3.8.1 state? It was useful in detecting a closed socket on the other end. Thank you.
Apr 17, 2014:
- 5:00 PM Ticket #2692 (Clear up the AutoIt3Wrapper Directives's documentation) updated by
-
Version changed
Automatic ticket cleanup. - 4:23 PM Ticket #2692 (Clear up the AutoIt3Wrapper Directives's documentation) closed by
- Rejected: The current version of the help file already has that text clarified. This is why we don't usually recommend putting in requests for versions prior to the current version or beta versions.
- 12:46 PM Ticket #2693 (_GUICtrlListView_GetItemTextArray - Return Value - proposal) closed by
- Fixed: Fixed by revision [10063] in version: 3.3.11.5
- 2:02 AM Ticket #2694 (AutoitX3_x64.dll not working for ControlListView and ControlTreeView ...) created by
- Have tried with both 3.3.8.1 and current version 3.3.10.2 Running …
Apr 16, 2014:
- 10:11 AM Ticket #2693 (_GUICtrlListView_GetItemTextArray - Return Value - proposal) created by
- in Return Value section now there is: […] description is not …
- 7:40 AM Ticket #2692 (Clear up the AutoIt3Wrapper Directives's documentation) created by
- Run Before And After Directives The following directives can …
Apr 9, 2014:
- 12:40 AM Ticket #2580 (Aut2Exe failing to run multiple times on Windows XP prior to SP3) updated by
- Delay 25"
Apr 8, 2014:
- 8:48 AM Ticket #2688 (StringToBinary + ConsoleWrite) updated by
- > Consolewrite by itself does not convert any variable Yes it does! Or rather: there is no consistency at all in the way various variants "print" themselves thru the method invoked by ConsoleWrite: * all strings are "converted" (i.e. emasculated) to ANSI, which is terribly wrong for a program claiming to be Unicode-aware. UTF-8 should be the default here. * integers, doubles, some keywords (True, False, Default) and pointers are consolewritten as strings, * Null and functions consolewrite nothing at all, * Binary spills verbatim. […]
Apr 7, 2014:
Apr 1, 2014:
- 9:03 PM Ticket #2596 (TCPRecv not returning data, and setting @error to -1) updated by
- I have found the same problem with UDPRecv returning the error -1 when empty. I have set the error handling to ignore error=-1.
- 8:33 AM Ticket #2690 (Win..... Return Value Proposal.) updated by
-
Summary changed
Note:
See TracTimeline
for information about the timeline view.
