ping

Raw sockets in monotouch

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 03:56:49
问题 I'm trying to implement ping function in MonoTouch. for some reasons, Ping class from System.Net.NetworkInformation doesn't work on the real device, so I decided to switch to raw sockets and implement ping myself. Unfortunately, I'm getting "Access Denied" message on: socket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp); Any idea how could ping be done in monotouch? And why can't I create raw sockets? 回答1: I have not tried raw socket but your Access Denied likely

How to add time stamp in the beginning of batch file result

我们两清 提交于 2019-12-08 03:43:39
问题 How can I add time stamp in the beginning of batch file results? Here's my current code: set dt=%date:~10,4%%date:~4,2%%date:~7,2% set tm=%time:~0,2%%time:~3,2%%time:~6,2% ping www.google.com -t -l 1 >PingLog_%dt%-%tm%.txt I want to the result to be similar to this: [hh:mm:ss] Reply from 120.89.12.38: bytes=1 time=1ms TTL=59 回答1: Small edit to add formatting: It's tested and works well here - though the time format on this PC is 24 hour time, which makes it work well. @echo off setlocal

Pause a batch file until a host is reachable (using ping)?

我是研究僧i 提交于 2019-12-08 03:10:33
问题 I'm looking to add some functionality to a batch file that I've been writing; essentially what happens is I dial up a VPN connection using openvpn and then continue to mount a network drive as well as many other things, what I'm looking to do is: Dial the connection via OpenVPN (which I have working fine) Ping a host on the other side of the VPN and don't continue through the batch file until this host is reachable. Currently I've been using a sleep command of 20 seconds which works, but is

Creating a Batch file that pings google constantly and testing the response time

China☆狼群 提交于 2019-12-08 02:54:03
问题 I'm trying to create a batch file that will constantly ping google.com and check the response time - "time=Xms". If the time <= 39ms the text of that ping(or the background) should be green. If the time > 40ms and < 80ms the text of that ping(or the background) should turn orange. If the time >= 80ms the text of that ping(or the background) should turn red. I have this batch at the moment which pings google every 3 seconds changes the background from green to red if the response fails: @echo

How To Ping using a specific Network Interface (or a specific source IP Address)?

走远了吗. 提交于 2019-12-08 02:22:06
问题 According to this link: using System.Net.NetworkInformation, is there a way to bind a ping to a specific interface? the ICMP cannot be bound to a Network Interface (unlike socket based stuff): ICMP is not socket based. The ping will be sent to the appropriate port based on the routing table.https://stackoverflow.com/editing-help But I can't see any proper way for getting the information about the "pinger". At least, in a shell command I could specify the source IP Address but not when I'm

Unable to change ping timeout in Excel VBA IP list ping

南笙酒味 提交于 2019-12-08 01:55:04
问题 The below code pings a list of IP addresses in an Excel sheet and returns the response time and TTL. Depending on the number of IP addresses the timeout can add up really fast and make for a long wait. Is there any way to add a custom timeout of 500ms? Sub Ping_Check() ' Based on http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/e59a38e1-eaf0-4b13-af10-fd4be559f50f/ Dim oPing As Object Dim oRetStatus As Object Dim xCell As Range Dim xLast_Row As Long Dim xWork1 As String xLast_Row

Is there a way to make an android device answer to icmp pings addressed to the broadcast address?

烈酒焚心 提交于 2019-12-08 01:26:43
问题 I would like to programatically make my device answer to broadcast pings (i.e pinging 192.178.1.255) while connected to a wifi network. Is there a way i can do that ? Maybe a listener that will ping back, or a flag to set somewhere? Thanks. 回答1: Is there a way i can do that ? In short: Yes. But it will take some good effort to integrate the necessary components. The key problem is that you need to listen for ICMP network packets. Such functionality is not accessible from Java and would

Proper way to test if server is up in Java?

心不动则不痛 提交于 2019-12-07 16:48:04
问题 What would be the proper way to simply see if a connection to a website/server can be made? I want this for an application I am coding that will just alert me if my website goes offline. Thanks! 回答1: You can use an HttpURLConnection to send a request and check the response body for text that is unique to that page (rather than just checking to see if there's a response at all, just in case an error or maintenance page or something is being served). Apache Commons has a library that removes a

Docker与Dockerfile极简入门文档

不羁的心 提交于 2019-12-07 14:35:44
引言 分享docker技术时写的一篇文档,图全部是自己画的。 docker的安装 docker的安装我就不多说,建议按照docker的官方安装文档一步一步来 https://docs.docker.com/install/ 。需要注意的是,Docker的windows版本只支持Win10的专业版和企业版,像我们普通学生用的Win10家庭版它是不支持的,但是docker官方也提供一个docker toolbox(下载地址: https://docs.docker.com/toolbox/toolbox_install_windows/ ),通过它可以在windows上运行docker,只不过这个docker toolbox是基于一个linux虚拟机运行的,所以性能肯定是不如原生的好。 安装好docker后,不要忘了用 service docker start 或者 systemctl start docker (如果是centos7以上版本的话)启动docker的服务 配置docker不需要sudo 刚装好的docker每次使用docker命令都需要sudo,比较麻烦,可以通过以下命令省去sudo: sudo usermod -aG docker 当前用户名 然后一定要记得重新登录该用户才能生效。 docker核心概念 要理解docker,最核心的是理解三个概念,分别是:仓库

Ensp配置静态路由和默认路由

牧云@^-^@ 提交于 2019-12-07 12:40:36
原理: ‘ 实验场景: 实验拓扑: 实验编址: 按照实验拓扑和实验编址搭好实验环境, 测试连通性 两台PC ping一下,发现无法连通 查看一下路由表: 可以看到在R1的路由表上,没有关于PC2所在网段的路由信息 同样的,R2上没有关于PC1和PC2所在网段的路由信息 R3上没有关于PC1所在网段的路由信息 也就是说在初始状态下,各个路由器只有与自身直连网段的路由信息。 现在PC1与PC2之间跨越了几个不同网段,要ping通需要在3台路由器上配置相应的路由信息。 可以通过配置静态路由来实现。 在R1需要加入网段10.0.20.0的信息 看R2的路由表,也需要加入目标网段20的下一跳路由 看R3的路由表,有20网段,但是ping可以过来,回去却找不到192.168.10.0网段呀, 同样的步骤,在R2上再弄一遍: 完成,成功ping通了 来源: https://www.cnblogs.com/arisskz6/p/12001302.html