Deathtorn Posted February 18, 2014 Posted February 18, 2014 I'm getting an @error return of -1 when using tcprecv() and im not sure what i need to do to figure out what that means, and how i can fix it. Any help would be appreciated,
JohnOne Posted February 18, 2014 Posted February 18, 2014 Post code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
bogQ Posted February 18, 2014 Posted February 18, 2014 (edited) What func do:Receives data from a connected socketSuccess: the binary/string sent by the connected socket.If it doesnt recive anything what will happend?Failure: "" and sets the @error flag to non-zero.@error: -1 Socket errorwindows API WSAGetError return value (see MSDN).So -1 is set when no msg is recived from client.If @error = -1 Then Sleep(100);and-or ContinueLoopIf @error And @error <> -1 Then; problem with TCPRecv communication, disconnect client!EndIf Edited February 18, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
Danp2 Posted February 18, 2014 Posted February 18, 2014 Isn't that backwards? Shouldn't it read: If @error = -1 Then ; problem with TCPRecv communication, disconnect client! Endif If @error And @error <> -1 Then Sleep(100);and-or ContinueLoop EndIf Latest Webdriver UDF Release Webdriver Wiki FAQs
bogQ Posted February 18, 2014 Posted February 18, 2014 (edited) No,If @error And @error <> -1 Thenis for "if there is WSAGetError" to delite errored socked from list if needed or what ever-1 error code isnt on WSAGetError list but instead its in autoit list i guess, think that WSAGetError to get last error in that case whud return 0soIf @error = -1 Thenis to check if something is recived or not, if nothing is recived that dont necessarily mean you need to dcc client. Your choice if you need it at all or to just put this insteadIf $Rec ThenIndicating to do something if something is recived (or nothing if nothing is recived)Im wondering if maybe "If @error = -1" checking can be faster than compering if string is emptu or not. Edited February 18, 2014 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
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