It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                7年前关闭。
            
                    
我想构建一个给定ip地址的代码,仅打印最终结果是否可达。我猜我们必须使用ping命令,但无法正确实现它。

最佳答案

请注意,IP网络上的“可达性”很难测试。

很有可能一台服务器计算机正在运行任何数量的实际服务(www,ftp等),但是自some people do that以来已配置为不回复ping。

如果可能,最好像要检查的真实服务一样进行连接。

10-04 12:15