diff options
Diffstat (limited to 'networkQuality.go')
| -rw-r--r-- | networkQuality.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/networkQuality.go b/networkQuality.go index ab9517e..7593714 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -21,6 +21,7 @@ import ( "fmt" _ "io" _ "log" + "net" "net/http" "os" "runtime/pprof" @@ -323,6 +324,24 @@ func main() { continue } + if *debugCliFlag { + // Note: This code is just an example of how to use utilities.GetTCPInfo. + rawConn := downloadSaturation.LGCs[randomLGCsIndex].Stats().ConnInfo.Conn + tlsConn, ok := rawConn.(*tls.Conn) + if !ok { + fmt.Printf("OOPS: Could not get the TCP info for the connection (not a TLS connection)!\n") + } + tcpConn, ok := tlsConn.NetConn().(*net.TCPConn) + if !ok { + fmt.Printf("OOPS: Could not get the TCP info for the connection (not a TCP connection)!\n") + } + if info, err := utilities.GetTCPInfo(tcpConn); err != nil { + fmt.Printf("OOPS: Could not get the TCP info for the connection: %v!\n", err) + } else { + utilities.PrintTCPInfo(info) + } + } + unsaturatedMeasurementTransport := http2.Transport{} unsaturatedMeasurementTransport.TLSClientConfig = &tls.Config{} if sslKeyFileConcurrentWriter != nil { |
