FLOW::idle_duration

Description

This iRule command returns the time in seconds when the flow was last used.

Syntax

FLOW::idle_timeout <any_chars>

Examples

when SERVER_CONNECTED {
    if {[catch { FLOW::create_related {
                        proto 6
                        clientflow [IP::remote_addr] 1221 [LINK::vlan_id]
                        serverflow [clientside {IP::remote_addr}] 1221 [clientside {LINK::vlan_id}]
                    } } result] } {
        log local0. "Couldn't create the connection, error:$result"
    } else {
        log local0. "Connection: $result TO [FLOW::peer $result]"
    }
    clientside {TCP::collect}
    TCP::collect
}

when CLIENT_DATA {
    # Log and refresh the related flow whenever the client sends data.
    log local0. "Flow idle duration before refresh [FLOW::idle_duration $result]"
    FLOW::refresh $result
    log local0. "Flow idle duration after refresh [FLOW::idle_duration $result]"
    TCP::release
    TCP::collect

}
when SERVER_DATA {
    # Log and refresh the related flow whenever the server sends data.
    log local0. "Flow idle duration before refresh [FLOW::idle_duration $result]"
    FLOW::refresh $result
    log local0. "Flow idle duration after refresh [FLOW::idle_duration $result]"
    TCP::release
    TCP::collect
}