GregChi Posted October 9, 2020 Report Share Posted October 9, 2020 When I use the command "pingsite", if there is no connection, response time is a long wait (up to 35 real seconds!!!). If there is a connection, response time is almost immediate. Is there a way to make the 'no connection' respond faster? 'Seconds to wait...' doesn't make any difference. code: <IF PING SUCCESSFUL URL="www.macros.com" Wait="1" NoEmbeddedVars="FALSE" _IGNORE="0x0007" _PROMPT="0x0003"/> <OR/> <IF PING SUCCESSFUL URL="www.comcast.com" Wait="1" NoEmbeddedVars="FALSE" _IGNORE="0x0007" _PROMPT="0x0003"/> <SOUND FILE File="E:\\Sounds\\Sparcle.wav" Wait="TRUE" _PROMPT="0x0007"/> <ELSE/> <SOUND FILE File="E:\\Sounds\\Fart.wav" Wait="TRUE" _PROMPT="0x0007"/> <END IF/> Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 I have some ideas, but I think I need some explanation from ISS. ISS: Is Ping using ICMP or and HTTP request? I don't think this is a "ping", I think it's a HTTP HEAD Request. Ping uses ICMP packets and is below the HTTP protocol. If memory serves, it's a part of the Internet Protocol. You might have seen the initialism TCP/IP before. I think it's part of the "IP" suite. But ISS shoudl be able to tell us. You see a ping only accepts a domain or subdomain as a parameter, one can't ping to a resource. That is, no path or resource name like "support.html" and this is what they show in their help file. Assuming it's using something like an HTTP HEAD, you need to be more specific about your terms. What do you mean by "no connection"? Do you mean you disabled your internet connection? I created a macro and set the wait time to 10 seconds but the macro showed me the fail message immediately. I also used Slowly to simulate a 10 second response delay, but that came back immediately as failed also. This isn't making sense to me. If it was an HTTP request and the server was slow to respond, my test shoudl have worked. But then that doesn't explain why it fails if it's ICMP ping. Hopefully ISS can shed some light on what's happening behind the scenes, but it does appear something is broken. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 In my test in the last paragraph I forgot to mention I disabled my network. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 Also I tried a URL without the https:// that I know takes a long time. It just happens to be a thorn in my side for some software I'm developing right now. Their response times are typically around 30 seconds as their back end servers are slow as molasses in a Montana winter. I tried with a 5 second parameter in the Ping Site command and it returned as failed immediately. I also increased the parameter to 5000 in case there was a mistake in units, milliseconds instead of seconds, but it came back immediately also. Once we know the mechanism being used we can judge if it's behaving normally or not. Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 9, 2020 Author Report Share Posted October 9, 2020 (edited) 4 hours ago, Cory said: What do you mean by "no connection"? Do you mean you disabled your internet connection? I have Comodo firewall which has a button to stonewall the internet from my cptr. This allows me to NOT be 24/7 allowing G***Le access to my personal info. Frustrating to wait that long for a response from?? It would be nice to know where the info would come from, but just having a response would be all I need. Greg Edited October 9, 2020 by GregChi Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 9, 2020 Author Report Share Posted October 9, 2020 Quote Link to comment Share on other sites More sharing options...
kevin Posted October 9, 2020 Report Share Posted October 9, 2020 @Cory: Ping uses ICMP. It is part of the TCP/IP protocol standard. 5 hours ago, GregChi said: When I use the command "pingsite", if there is no connection, response time is a long wait (up to 35 real seconds!!!). If there is a connection, response time is almost immediate. Is there a way to make the 'no connection' respond faster? When the Ping or If Ping macro commands run, the first thing that happens is Macro Express checks to see if there is a connection and, if there is a connection it checks to see if the IP address or URL is valid. The Timeout value specified in the Ping and If Ping commands has no effect on these tests. Once it is determined that there is a connection and the IP address or URL is valid then the Ping actually happens at that point, the Timeout value is used. The amount of time it takes to determine whether or not you are connected to the network or if the IP address is valid occurs in WIndows. So, no, there is not a way to make it faster. The Ping command included in Windows seems to work differently. You might be able to have the test for a connection work more quickly if you call it instead. Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 9, 2020 Author Report Share Posted October 9, 2020 4 minutes ago, kevin said: The amount of time it takes to determine whether or not you are connected to the network or if the IP address is valid occurs in WIndows. So, no, there is not a way to make it faster. OK, then is there a way in ME6 to set a trigger that responds to a 'no reaction/response from the cmd in 2-5 seconds'? Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 9, 2020 Author Report Share Posted October 9, 2020 12 minutes ago, kevin said: Macro Express checks to see if there is a connection Is there a readable flag at this point ? Quote Link to comment Share on other sites More sharing options...
kevin Posted October 9, 2020 Report Share Posted October 9, 2020 46 minutes ago, GregChi said: OK, then is there a way in ME6 to set a trigger that responds to a 'no reaction/response from the cmd in 2-5 seconds'? No. The Ping Site / If Ping commands call some Windows APIs. Those are taking the time. 41 minutes ago, GregChi said: Is there a readable flag at this point ? Not directly. But ... You might try the If Online / If Not Online commands to see if they work faster. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 If you disable your network then there is no path an an ICMP ping will complete quickly and tell you there's no route. Kevin: Please explain how ICMP Ping can access a resource only accessible with HTTP. In the Help for MEP is clearly shows an example of a URI pointing to "support.htm". Also it says to omit the scheme. HTTP requires a scheme to access a resource. It needs to know if it's HTTP, HTTPS, FTP, SMTP, or whatever protocol to use. It seems contradictory to omit she scheme suggests ICMP ping as it is a protocol (IMCP is a protocol like HTTP) and doesn't use it, but having a path suffest HTTP or other protocol that uses a path to resources. Quote Link to comment Share on other sites More sharing options...
kevin Posted October 9, 2020 Report Share Posted October 9, 2020 The ping command ignores protocols such as HTTP, HTTPS, FTP, or SMTP. It only uses an IP Address or Host Name. Enter an IP address such as 209.197.94.249 or a host name like www.macros.com. The only valid entry in this field is an IP Address or a Host Name. This cannot include the protocol identifier http://, https://, ftp://, or smpt:// . Nor can it include specific pages like .htm, .html, or .apx. There is a problem in the Help. The example value of https://www.macros.com/abc%23%/support.htm is not valid. This example should be something like "www.macros%23%.com". We will fix the help. Quote Link to comment Share on other sites More sharing options...
kevin Posted October 9, 2020 Report Share Posted October 9, 2020 28 minutes ago, Cory said: If you disable your network then there is no path an an ICMP ping will complete quickly and tell you there's no route. When the network is disabled the Ping Site command still uses Windows APIs to see if you are connected and to try to resolve the Host Name to an IP Address. This may not happen "quickly". Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 Windows API and such: Correct. But the purpose of the timeout in the Windows Ping command is for network delays. A ping packet is sent and tries to route itself as any packet. It does a cost analysis and makes the best decision on the route. A ping is sent to one router to the next and to the next. TraceRoute shows this better. At each router the transmitting router waits a given period of time before giving up and sending the result of failure back. The user can specify how long to wait on each hop. This is the Ping timeout parameter. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 9, 2020 Report Share Posted October 9, 2020 "The ping command ignores protocols such as HTTP, HTTPS, FTP, or SMTP" Not exactly. As I stated clearly in a precious message, it it it's own protocol along side these. You can take a train, plane, or an automobile. They don't ignore the others, they're completely different methods of travel and have nothing to do with each other. So too are the protocols in TCP/IP. Thanks for explaining the mistake in the help. Now it makes much more sense. I suggest that you suggest using an IP address to avoid failures associated with DNS lookups. One of the most useful principles of troubleshooting: K.I.S.S. 🙂 Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 10, 2020 Author Report Share Posted October 10, 2020 Kevin & Cory, Thanks, I'll try these ideas. Greg Quote Link to comment Share on other sites More sharing options...
Cory Posted October 10, 2020 Report Share Posted October 10, 2020 What are you hoping to accomplish? Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 10, 2020 Author Report Share Posted October 10, 2020 When I want to go online, I want a fail-safe indicator that the connection from my computer to the net is functioning. If, when I ping & get a response almost immediately, then i am set. If I DON'T get a response, I have to wait 'till any response is finished (up to 35 sec) before I can continue. If I don't do this, there is no indication as to why my access to the net is not working,,,,, Determining this will clue me as to where the problem is occurring. (sometimes my macros don't react as I programmed them to do 😩) Various 'chrome' g***le browsers love to skip/steal keystrokes...... I want 'my' macros to respond in a reasonable fashion. end of rant Quote Link to comment Share on other sites More sharing options...
Cory Posted October 10, 2020 Report Share Posted October 10, 2020 I wouldn't bother creating a macro for which many programs already exist. You could use a monitoring program for instance. I use Net Uptime Monitor. Quire useful. You can also use Windows command program Ping. You can set the number of pings to infinite and control the time between pings. Say have it try every 10 seconds. Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 10, 2020 Author Report Share Posted October 10, 2020 46 minutes ago, Cory said: Windows command program Ping This gives me the fast response I desire, now to learn how to program 'cmd' Thanks, Greg Quote Link to comment Share on other sites More sharing options...
Cory Posted October 10, 2020 Report Share Posted October 10, 2020 No need for a macro. Windows Start > Command Prompt. MS Ping reference. You probably want to use \t is memory serves to make the pinging perpetual. Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 10, 2020 Author Report Share Posted October 10, 2020 I may go online/offline 30 times in a day, so I want a macro to auto-control this. I don't believe in inet always connected, too many phissures,scammers, etc. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 10, 2020 Report Share Posted October 10, 2020 Good luck. Quote Link to comment Share on other sites More sharing options...
GregChi Posted October 10, 2020 Author Report Share Posted October 10, 2020 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.