I have code that goes on a LAN hosted server to get some information. This LAN server is of course only available when you are connected to the right internet connection.
Is there a way of which I can check what connection the PC is using, so I don't try to scrape the server without there being a connection?
I already do a try
and except
setup to catch the exception that is thrown when the server doesn't answer 'cause you're connected to a wrong internet. This lags the program heavily, so I was hoping that there were some way via 'OS' of checking what internet I am connected to?
I was hoping that something along the lines of this was possible:
If(internetConnectionName == “[name of internet]”
{
#Usable code...
}
Else
{
#Other code
}
The above is of course pseudo code.