ChinaUnix.net
相关文章推荐:

python 实现ping命令

#!/usr/bin/env python """ping.py ping.py uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. Copyright (C) 2004 - Lars Strand ; This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at you...

by alexnetwork - Python文档中心 - 2009-03-18 13:13:24 阅读(1797) 回复(0)

相关讨论

几个月前看到某网游公司的服务端监控程序有一个功能,从服务器反ping各客户端,进而了解各客户端到服务端的ping高低,以及客户端大致的区域分布情况,于是有想法自己用python也写一个。今天网上查到一个python实现ping的源码,看了一下,很不错。 重点是发现别人写的代码格式很优美,我的相比简直太差了。哎,努力学习。 先转贴别人的源码,这几天有空后再根据这个改进,逐步达到我的设计目标。 代码我在python 2.6 elicpse wind...

by hawkli - Python文档中心 - 2009-07-23 14:52:45 阅读(2732) 回复(0)

#!/usr/bin/env python # -*- coding: iso-8859-1 -*- """ping.py ping.py uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. Copyright (C) 2004 - Lars Strand This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; eith...

by atyu30 - BSD文档中心 - 2007-11-11 00:11:35 阅读(1176) 回复(0)

// created by joe lumbroso // see some other good php3 scripts // goto http://www.dtheatre.com/scripts echo "pinging "; $to_ping = "google.com"; $count = 3; $psize = 65; echo " Please be patient, this can take a few moments...\n "; flush(); while (1) { ?> 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1222/showart_159990.html

by windlike - php文档中心 - 2006-08-24 15:26:21 阅读(781) 回复(0)

为了能够正常地使用系统自带命令先来分析一下原理吧! linux ping 命令详解 功能说明:检测主机。 语  法:ping [-dfnqrRv][-c][-i][-I][-l][-p][-s][-t][主机名称或IP地址] 补充说明:执行ping指令会使用ICMP传输协议,发出要求回应的信息,若远端主机的网络功能没有问题,就会回应该信息,因而得知该主机运作正常。 参  数: -d 使用Socket的SO_DEBUG功能。 -c 设置完成要求回应的次数。 -f 极限检测。 -i 指定收发信息的间隔...

by hkebao - Python文档中心 - 2009-03-11 11:57:35 阅读(1359) 回复(0)

import java.io.*; import java.net.*; import java.nio.channels.*; import java.util.*; import java.util.regex.*; public class ping { static int DAYTIME_PORT = 13; static int port = DAYTIME_PORT; static class Target { InetSocketAddress address; SocketChannel channel; Exception failure; long connectStart; long connectFinish = 0; boolean shown...

by kumwolf - Java文档中心 - 2008-11-10 21:23:10 阅读(907) 回复(0)

我写了个程序,在语言中调用ping命令检查对方的计算机是没有开机,不知道各位怎么搞这个程序。 1、在c语音中调用ping命令; 2、在c中用其它命令来检查 谢谢 希望大家多多帮助!

by fy201314 - C/C++ - 2005-12-22 15:41:32 阅读(4208) 回复(13)

ping命令 ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式 ping命令的使用: ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式: 1、-t ping the specified host until stopped .To see statistics and continue -type control-break; To stop -type control -c. 不停的ping 地方主机,直到到你按下control-c。control-b...

by taiyangyuyuelia - 网络技术文档中心 - 2008-06-23 13:37:52 阅读(1239) 回复(0)

ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式 ping命令的使用: ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式: 1、-t ping the specified host until stopped .To see statistics and continue -type control-break; To stop -type control -c. 不停的ping 地方主机,直到到你按下control-c。control-break 是...

by qyelite - 网络技术文档中心 - 2007-03-01 00:23:37 阅读(601) 回复(0)

ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式 ping命令的使用: ping 的ip都用192.168.0.72实验。为了缩小篇幅,例子就不写了,只写出它的格式: 1、-t ping the specified host until stopped .To see statistics and continue -type control-break; To stop -type control -c. 不停的ping 地方主机,直到到你按下control-c。control-break 是暂时...

by bluexjj - 网络技术文档中心 - 2005-10-17 09:47:52 阅读(666) 回复(0)

在FreeBSD中能否实现响应ping命令时只返回固定的包长?如对端用1000 bytes的包长ping,我只返回56 bytes? 如: C:\>ping www.sina.com.cn -l 1000 pinging jupiter.sina.com.cn [218.30.66.101] with 1000 bytes of data: Reply from 218.30.66.101: bytes=56 (sent 1000) time=43ms TTL=244 Reply from 218.30.66.101: bytes=56 (sent 1000) time=42ms TTL=244 Reply from 218.30.66.101: bytes=56 (sent 1000) time=42ms TT...

by bbssdd01 - BSD - 2008-04-09 09:11:49 阅读(1841) 回复(1)