Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
76 user(s) are online (67 user(s) are browsing Forums)

Members: 3
Guests: 73

NinjaCyborg, nbache, samo79, more...

Support us!

Headlines

 
  Register To Post  

detecting network
Quite a regular
Quite a regular


See User information
I'm looking for ways to detect:

1. whether the network is up (a way that is more elegant than parsing "c:shownetstatus" output)

2. if the network has a connectivity with the outside world (tcpip stack can be up but the connectivity is inside LAN only, I want to detect this scenario to prevent unecessary connection that would fail).

The programming language is AREXX, but network access is done using python scripts.
A brief google-ing on detecting network inside python didn't reveal anything useful

Does anyone has some ideas?

TIA,
Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top
Re: detecting network
Not too shy to talk
Not too shy to talk


See User information
@Jack

Quote:
2. if the network has a connectivity with the outside world (tcpip stack can be up but the connectivity is inside LAN only, I want to detect this scenario to prevent unecessary connection that would fail).


I don't think there is a generic solution for that other than to connect to a site on the internet and see if the connection fails (which is what you explicitly didn't want).

You would have to connect to the router and ask for its online/offline status. This is a router-specific solution and you cannot support all known and unknown routers in the world.

Bye,
Thomas

Go to top
Re: detecting network
Not too shy to talk
Not too shy to talk


See User information
@thomas

I would just try and resolve example.com

Go to top
Re: detecting network
Quite a regular
Quite a regular


See User information
@thomas

Quote:

You would have to connect to the router and ask for its online/offline status. This is a router-specific solution and you cannot support all known and unknown routers in the world.


Not good. I want a generic solution for program that goes public. If I don't, some python script that participate in the program throw out ugly stuff.
Maybe I'll settle to "python *>NIL:" or somthing

Thanks anyway
Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top
Re: detecting network
Quite a regular
Quite a regular


See User information
@xeron

Quote:

I would just try and resolve example.com


I'll see if it is quiet enough and doesn't implies any unreasonable delays.

Thanks.
Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top
Re: detecting network
Quite a regular
Quite a regular


See User information
Meanwhile "python *>NIL:" takes care of the ugly err messages when network is down or local only.
Still will have to produce a more clean solution...

Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project