funkey Posted August 16, 2013 Posted August 16, 2013 Hello, I just want to know if this is a bug? Global $Info = _GetServerInfo() If @error Then ConsoleWrite("Error " & @error & " getting info" & @CRLF) Else ConsoleWrite($Info & @CRLF) EndIf Func _GetServerInfo() UDPStartup() Local $socket = UDPOpen("192.168.5.5", 20500) If @error <> 0 Then Return SetError(1, 0, "") UDPSend($socket, "GetServerInfo" & Chr(0)) If @error <> 0 Then Return SetError(2, 0, "") Local $data = UDPRecv($socket, 50, 2) ; if UDP-server is not reachable, then no error is set and no array is created If @error <> 0 Then Return SetError(3, 0, "") UDPCloseSocket($socket) UDPShutdown() Return $data[0] EndFunc ;==>_GetServerInfo If server IP is local IP then an error is thrown as expected. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
FireFox Posted August 16, 2013 Posted August 16, 2013 Hi,If the server is reachable you mean?I have the same issue, it returns an empty string with the flag set to 2.Br, FireFox.
funkey Posted August 17, 2013 Author Posted August 17, 2013 So should I open a ticket in Bugtracker? Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
Developers Jos Posted August 17, 2013 Developers Posted August 17, 2013 (edited) It looks like the @Error isn't set in case the FD_ISSET call fails, meaning the UDP socket isn't ready, so guess this is indeed an bug that needs to be looked at. Edited August 17, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Administrators Jon Posted August 18, 2013 Administrators Posted August 18, 2013 Fixed for next beta. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/
funkey Posted August 18, 2013 Author Posted August 18, 2013 Thanks, Jon! Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
FrankwazHere Posted January 26, 2014 Posted January 26, 2014 (edited) Hi Guys, Since the version 10, this TCPRecv change has broken my script... if I compile the script with version 8 the connection is stable and doesn't throw any @error While 1 $recv = TCPRecv($Socket, 1024) If @error Then Connect() EndIf now when i compile the same script with version 10 it just connects, @error's - disconnects, then connects again, @errors - disconnects, in a loop. I viewed the @error with a messagebox it returned -1, why would this work on the old 8 but not on the new 10 version. is it one of those, Fix one thing, break another scenario? Thanks; Edited January 26, 2014 by FrankwazHere ;Frank.
Graeme Posted March 20, 2014 Posted March 20, 2014 (edited) I have a small script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If Not UDPStartup() Then MsgBox (0,"UDPStartup",@error & "TunnelDisabledActionString") Else $UDPLogPort = Random(20000,65535,1) $UDPLogReceiver = UDPBind("127.0.0.1",$UDPLogPort) If (@error > 0) Then $UDPLogPort = Random(20000,65535,1) $UDPLogReceiver = UDPBind("127.0.0.1",$UDPLogPort) If (@error > 0) Then MsgBox (0,"UDPBind",@error&"TunnelDisabledActionString") $UDPLogReceiver[0] = 0 EndIf Else MsgBox(0,"UDPBind","Realsocket=" & $UDPLogReceiver[1] & " IP=" & $UDPLogReceiver[2]&" port= "& $UDPLogReceiver[3]) EndIf EndIf For $I = 1 to 1 If $UDPLogReceiver[0] <> 0 Then $received = UDPRecv($UDPLogReceiver,16000) If @error And (@error <> 10040) Then MsgBox(0,"UDPRecv",@error) Else MsgBox(0,"UDPRecv",$I&" "&$received) EndIf EndIf Sleep(100) Next and it gives different results run under 3.3.8.1 and 3.3.10.2 as attached Is this a bug that still exists? Sorry if this is the wrong place for the question but I thought it would be good to continue the thread. So basically the error results in 3.3.10.2 but not in 3.3.8.1 it shows $I instead. Edited March 20, 2014 by Graeme
jpm Posted March 21, 2014 Posted March 21, 2014 In fact the Jos remark is still valid the socket is not ready. The only think you can contest is that -1 in the doc means invalid socket array which is not the reality
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