Skip to content

Commit

Permalink
Backport improved network module design
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Nov 7, 2022
1 parent fb76805 commit a68cb81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modPing.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
My.Settings.Ping_Enable = True
My.Application.Log.WriteEntry("Ping module is enabled")
Load()
GetPublicIPAddress()
Return "Ping module enabled"
End Function

Expand Down Expand Up @@ -68,12 +69,17 @@

response = Ping(My.Settings.Ping_InternetCheckAddress)
If response.StartsWith("Reply from") Then
My.Application.Log.WriteEntry(response, TraceEventType.Verbose)
If modGlobal.IsOnline = False Then
My.Application.Log.WriteEntry("System is now connected to the Internet", TraceEventType.Information)
GetPublicIPAddress()
End If
modGlobal.IsOnline = True
ElseIf response = "Ping disabled" Then
' Do nothing, Ping is disabled
Else
My.Application.Log.WriteEntry(response, TraceEventType.Warning)
If modGlobal.IsOnline = True Then
My.Application.Log.WriteEntry("System is not connected to the Internet", TraceEventType.Warning)
End If
modGlobal.IsOnline = False
End If
End Sub
Expand Down

0 comments on commit a68cb81

Please sign in to comment.