ping

Return IPv6 address Python from domain name

半城伤御伤魂 提交于 2019-12-13 09:50:04
问题 So I searched a little on the Internet and I found that the socket class can return the IPv4 address from the domain name in python. IP address of domain on shared host says how to do it. Can I do exactly the same thing but return IPv6 address? It looks like support for IPv6 in Python is a bit limited and I found no resources searching on the Internet. 回答1: Take a look here, I think this is what you are looking for. socket.getaddrinfo("example.com", None, socket.AF_INET6) 回答2: You can use

How to do network Ping .NET

送分小仙女□ 提交于 2019-12-13 09:44:59
问题 I did a small program that ping my entire network, but I think I have a problem because some equipment stop working (it runs every 2 minutes and takes 1 minute to complete the operation), the question is: ¿Is there a better way to do this? Here the code: Console.WriteLine("Haciendo ping a los equipos, no cierre esta ventana... "); Ping ping = new Ping(); byte[] buffer = new byte[32]; PingOptions pingoptns = new PingOptions(128, true); int timeout = Convert.ToInt32(ConfigurationManager

batch file ping output to text file

放肆的年华 提交于 2019-12-13 06:13:57
问题 @echo off ping www.google.com > pinglog.txt pause I have this command but my problem is when you add ">" or ">>" the command prompt will not show what is going on on the background. Is there a way that everything will be copied after doing the ping? I am aware of this code as well: @echo off ping www.google.com > pinglog.txt type pinglog.txt pause but still, the screen stays blank as if nothing happens. I hope someone can help 回答1: Pipe to a Tee command. ping www.google.com | cscript //nologo

Modifying VB.Net program that uses normal ping method to use Async ping method

[亡魂溺海] 提交于 2019-12-13 04:47:34
问题 I have created a program which acts as both a simple local area network map, but also as a troubleshooting program for pinpointing faults (ie. determining where a connection might be broken). There is a main screen that looks like this: Image 1 and each button links to subscreens, such as this: Image 2 The program works well enough as is, but using the normal ping method it requires each ping to finish before sending the next one and can sometimes freeze up the program for several seconds

Batch file :: if lss is not working properly

≯℡__Kan透↙ 提交于 2019-12-13 03:56:41
问题 My code is pretty much self explanatory : @echo off set /a n=0 :doitagain set /a n+=1 echo Pinging : 10.0.0.%n% ping 10.0.0.%n% if %n% lss 255 goto doitagain pause >nul but it always pinging 10.0.0.1 so I guess tiny tweak needed here... 回答1: As npocmaka stated in his comment you always need delayed expansion when you are working with variables which are modified inside a loop. The first step is to add SETLOCAL EnableDelayedExpansion somwhere at teh beginning of your code. The second step is

Test IP reachability with ERRORLEVEL of ping.exe

蹲街弑〆低调 提交于 2019-12-13 03:47:02
问题 Background I want to check whether a specified host is IP reachable before some operation in .bat file. I tried using ping.exe to test IP reachability, but I found ping.exe returns ERRORLEVEL 0 when the specified host is IP reachable or the network is unreachable. Question How can I test IP reachability of a specified host in .bat file? Is there any way to distinguish IP reachable and network unreachable with ping.exe , or any other command to test IP reachability? 回答1: You can use also use a

Hyperledger: Error trying to ping. Unexpected end of JSON input

这一生的挚爱 提交于 2019-12-13 03:34:07
问题 I'm trying to deploy my own .bna file to a business network using this tutorial. The only difference is that I am doing this with three organizations. Everything works fine until I run the step eight because when I run this command: composer network ping -c alice@trade-network I got this error: Error trying to ping. Unexpected end of JSON input. Does anybody know how can I solve this? Thank you 回答1: I had the same issue, and I knew it was a matter of local configuration since it stopped

How to stop while($true) that contains start-sleep in powershell

倖福魔咒の 提交于 2019-12-13 02:11:32
问题 My google-fu has failed me. I've got a pretty simple script that just tests ping connectivity from one server to another, and displays a runtime at the top. I'd like to be able to stop this script at any time with a single keypress ("q" in the script) and have it give some basic stats about how long it ran, and how many times it failed. I can stop the script with ctrl+c, but that completely exits and doesn't allow me to show any stats. Below is my script. Any help is appreciated! ############

Pinging a server in php without the port?

让人想犯罪 __ 提交于 2019-12-13 00:49:41
问题 I have been having problems with a script i have been tampering with. I am trying to make an online checker for my game server, so i can indicate if my server is online or down from my website. Here is my code: <?php if (!$socket = @fsockopen(IP, Port, $errno, $errstr, 2)) { echo "<center><img style='float:left;' src='images/offline_icon.png'><font style='float:left;' size='5' color='red'><strong>Offline!</strong></font></center>"; } else { echo "<center><img style='float:left;' src='images

How to send Ping6 request using Java library (JpCap)

两盒软妹~` 提交于 2019-12-12 22:18:15
问题 I would like to monitor the ipv6 devices using ping6 request. Please let me know is there any open source library is available to send and receive Ping6 request. I tried with JpCap but couldn't succeed and I got the below error message java.io.IOException: only IPv4 packet is supported at jpcap.JpcapSender.nativeSendPacket(Native Method) at jpcap.JpcapSender.sendPacket(JpcapSender.java:93) at Ping6.sendPing6Request(Ping6.java:131) at Ping6.main(Ping6.java:40) Please help me how to solve this