diff options
| author | Will Hawkins <[email protected]> | 2022-06-04 21:24:19 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-06-04 21:24:19 -0400 |
| commit | 9be87fa5ec89c9e393c9c93b3cb36668c71593d6 (patch) | |
| tree | 7c5a5df400370660c670935dc36e2e4b0493ab86 /networkQuality.go | |
| parent | de7a7bf994a020049eca89098aab9d13ff81f361 (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.go | 7 |
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) } |
