hiredblade Posted December 10, 2013 Share Posted December 10, 2013 Hello people. I am making a communication app which pokes the server for response. And afterwards the communication begins. So I am using UDPOpen to create a socket to poke, and UDPRecv to listen. The problem is UDPRecv lags behind, since it waits for data for 100ms. I use the first packet arrival time as some sort of ping. So miliseconds are important here.A similar issue has been solved here.'?do=embed' frameborder='0' data-embedContent>> My issue is a bit different though. I need to connect via UDPOpen and not to localhost, so I cannot know the local port for the socket.Here comes the questions; 1- From Autoit Help, UDPOpen; "Returns an array : $array[1] contains the real socket" What does it mean by "real socket"? 2- Is there a way to find out the local port for a socket? If so how?Note; Server program is not mine, so I cannot change the way it behaves. Thanks in advance. Link to comment Share on other sites More sharing options...
Gianni Posted December 10, 2013 Share Posted December 10, 2013 Hi hiredblade perhaps >this may be of interest to you Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Solution funkey Posted December 10, 2013 Solution Share Posted December 10, 2013 1: The real socket is the socket used for communication. You don't need to know much about it, if you are using AutoIt. For more information read in Wikipedia or some tutorials like this one: http://www.binarytides.com/winsock-socket-programming-tutorial/2: Try to use my socket UDF: There is a function called _GetLocalPort($iSocket). 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. Link to comment Share on other sites More sharing options...
hiredblade Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) Thank you guys I will need some time to study and understand your suggestions. Also, using winsock dll directly can solve my problem, and thanks to funkey I do not have to write an UDF myself. I consider this solved. Edited December 11, 2013 by hiredblade Link to comment Share on other sites More sharing options...
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