summaryrefslogtreecommitdiff
path: root/networkQuality.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2022-06-04 21:24:19 -0400
committerWill Hawkins <[email protected]>2022-06-04 21:24:19 -0400
commit9be87fa5ec89c9e393c9c93b3cb36668c71593d6 (patch)
tree7c5a5df400370660c670935dc36e2e4b0493ab86 /networkQuality.go
parentde7a7bf994a020049eca89098aab9d13ff81f361 (diff)
[Feature] Add conditional compilation support for GetTCPInfo
Now there is functionality for conditionally supporting GetTCPInfo depending on the platform. If the platform supports it, then the client can call utilities.GetTCPInfo. In the case that the platform does not support the GetTCPInfo function call, the result is an error of the type `NotImplemented`.
Diffstat (limited to 'networkQuality.go')
-rw-r--r--networkQuality.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/networkQuality.go b/networkQuality.go
index 7593714..d9bdc94 100644
--- a/networkQuality.go
+++ b/networkQuality.go
@@ -336,7 +336,12 @@ func main() {
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)
+ switch err.(type) {
+ case *utilities.NotImplemented:
+ fmt.Printf("GetTCPInfo not implemented on this platform.\n")
+ default:
+ fmt.Printf("OOPS: Could not get the TCP info for the connection: %v!\n", err)
+ }
} else {
utilities.PrintTCPInfo(info)
}