For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > September 2004 > How detect internet connection?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How detect internet connection?
Erik Kullberg

2004-09-27, 3:55 am

I have a local network, connected to the Internet via a router (sharing
connection). The internet connection is turned on/off as needed by any of
the computers. This works well, exept for one thing - too often a user shuts
down the internet connection, thereby putting a stick in the wheel for other
users.
Is there a way to detect that another user in the local network is connected
outwards?
Any other idea?

========================================
======
Erik Kullberg
Address: Enhagsvägen 2
S-589 43 Linköping
Sweden
Tel home: +46 (0)13 21 94 35
Tel mobile: +46 733 56 19 56
E-mail: erik.kullberg@telia.com
My place: N 58 deg, 23.115' - E 015 deg, 42.137'


Colin McKinnon

2004-09-27, 3:57 pm

Erik Kullberg spilled the following:

> I have a local network, connected to the Internet via a router (sharing
> connection). The internet connection is turned on/off as needed by any of
> the computers. This works well, exept for one thing - too often a user
> shuts down the internet connection, thereby putting a stick in the wheel
> for other users.
> Is there a way to detect that another user in the local network is
> connected outwards?
> Any other idea?
>


Only for stateful protocols.

Assuming you're using Linux, there are lots of tools managing connections
transparently - e.g. diald, smpppd.

If you want to be able to monitor activity from an application the easiest
way might be to periodically run ifconfig and look at the bytes
sent/received for the interface you're interested in.

If you're using Microsoft...?

HTH

C.
Erik Kullberg

2004-09-27, 8:56 pm

I forgot to tell that I use Windows XP, sp2.
I read between your lines that this is not an advantage in this matter ... ?

/ Erik


"Colin McKinnon"
<colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com> skrev i
meddelandet news:AeX5d.203$7a5.187@newsfe1-gui.ntli.net...
> Erik Kullberg spilled the following:
>
>
> Only for stateful protocols.
>
> Assuming you're using Linux, there are lots of tools managing connections
> transparently - e.g. diald, smpppd.
>
> If you want to be able to monitor activity from an application the easiest
> way might be to periodically run ifconfig and look at the bytes
> sent/received for the interface you're interested in.
>
> If you're using Microsoft...?
>
> HTH
>
> C.



Serge911

2004-09-28, 4:00 pm

Something silly which has nothing to do with php (since I am far from being
a gourou) but can't you try in your script to connect to a ressource
available from the web to find out if you have access or not ?

.... for what it's worth ...

S.

"Erik Kullberg" <erik.kullberg@telia.com> a écrit dans le message de
news:yL%5d.104447$dP1.381050@newsc.telia.net...
> I forgot to tell that I use Windows XP, sp2.
> I read between your lines that this is not an advantage in this matter ...

?
>
> / Erik
>
>
> "Colin McKinnon"
> <colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com> skrev i
> meddelandet news:AeX5d.203$7a5.187@newsfe1-gui.ntli.net...
of[color=darkred]
wheel[color=darkred]
connections[color=darkred]
easiest[color=darkred]
>
>



Erik Kullberg

2004-09-29, 4:57 am

The trouble is not to find out whether there is an internet connection or
not, but to know if any of
the others on the intranet is using it or not! If nobody but me is using it,
then I can disconnect, otherwise I should not.

/ Erik


"Serge911" <serge911@free.fr> skrev i meddelandet
news:41598618$0$1497$636a15ce@news.free.fr...
> Something silly which has nothing to do with php (since I am far from
> being
> a gourou) but can't you try in your script to connect to a ressource
> available from the web to find out if you have access or not ?
>
> ... for what it's worth ...
>
> S.
>
> "Erik Kullberg" <erik.kullberg@telia.com> a écrit dans le message de
> news:yL%5d.104447$dP1.381050@newsc.telia.net...
> ?
> of
> wheel
> connections
> easiest
>
>



Chris Allen

2004-09-29, 8:03 pm

Which XP?

I'm pretty sure with XP Professional you can set one machine to be the
router and have that make the connection whenever anyone wants access to the
internet, it doesn't connect if its the local or non-routable IP.

This would take the connection control away from individual users. You could
set the router machine to disconnect after a period of inactivity.

Also I see you've included your whole real email address in your post.
Generally this is to be avoided unless you are a spam fan.

HTH
Chris


"Erik Kullberg" <erik.kullberg@telia.com> wrote in message
news:yL%5d.104447$dP1.381050@newsc.telia.net...
> I forgot to tell that I use Windows XP, sp2.
> I read between your lines that this is not an advantage in this matter ...

?
>
> / Erik
>
>
> "Colin McKinnon"
> <colin.thisisnotmysurname@ntlworld.deletemeunlessURaBot.com> skrev i
> meddelandet news:AeX5d.203$7a5.187@newsfe1-gui.ntli.net...
of[color=darkred]
wheel[color=darkred]
connections[color=darkred]
easiest[color=darkred]
>
>




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com