【问题标题】:How to check the status of a link?如何检查链接的状态?
【发布时间】:2017-06-09 08:57:39
【问题描述】:

我正在使用 AODV 路由协议在 ns2 中运行 MANET 模拟。有什么方法可以检查节点是否将接收到的数据转发到路由中的下一个节点或检查 2 个节点之间的链接是否处于活动状态?

【问题讨论】:

    标签: network-programming tcl ns2 wireless


    【解决方案1】:

    试试这个:

    package require http
    package require tls
    http::register https 443 [list ::tls::socket -tls1 1]
    set url "https://google.com"
    if {![catch {set token [::http::geturl $url]} msg]} {
        if {[::http::status $token] == "ok"} {
            #Do something when token is ok for example print HTTTP code
            puts [::http::code $token]
        } else {
            #Do something when status token is not ok
        }
    } else {
        #print error when Url is invalid or host is unreachable
         puts "oops: $msg"
    }
    

    【讨论】:

    • 这与问题完全无关,这是关于在网络模拟器中测试路由,而不是与谷歌谈论 HTTPS。您的意思是将其发布为另一个问题的答案吗?
    猜你喜欢
    • 2019-10-02
    • 1970-01-01
    • 1970-01-01
    • 2016-11-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-06
    • 2018-06-06
    • 1970-01-01
    相关资源
    最近更新 更多