School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,161 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,507 people online right now. Registration is fast and FREE... Join Now!




check network connection

 

check network connection

devangnegandhi

24 Aug, 2007 - 06:37 AM
Post #1

New D.I.C Head
Group Icon

Joined: 23 Jan, 2006
Posts: 40



Thanked: 1 times
Dream Kudos: 100
My Contributions
i wanted to know that is there any javascript object by which i can check if there is a network connection present at a perticular point in time!!

User is offlineProfile CardPM
+Quote Post

 
Reply to this topicStart new topic
Replies(1 - 5)

skyhawk133

RE: Check Network Connection

24 Aug, 2007 - 08:09 AM
Post #2

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,883



Thanked: 156 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
I don't believe so. You might look to see if there is some sort of ActiveX that would accomplish this.

You could do some sort of very crude test to see if the computer was connected to the internet or not. This would most likely involve requesting an image using javascript and using the onError handler to check if the image loaded. If the image didn't load, you would assume you weren't connected to the internet.
User is online!Profile CardPM
+Quote Post

no2pencil

RE: Check Network Connection

24 Aug, 2007 - 08:36 AM
Post #3

i R L33t Skiddie, k?
Group Icon

Joined: 10 May, 2007
Posts: 13,499



Thanked: 303 times
Dream Kudos: 2875
Expert In: Goofing Off

My Contributions
I don't think that the html level is where you should conduct network connection testing. Even if the webserver is on the local network, should the web service on the server be down (not running, stalled, timed out) then the page will fail. Are you wanting to test the network connection of the client to the webserver, the existance of the webserver (as seen by the client), or the network connection of the webserver to the client?

<edit>
These referances should shed some light:
http://www.webopedia.com/quick_ref/OSI_Layers.asp
IPB Image
</edit>

This post has been edited by no2pencil: 24 Aug, 2007 - 08:40 AM
User is online!Profile CardPM
+Quote Post

devangnegandhi

RE: Check Network Connection

24 Aug, 2007 - 08:49 AM
Post #4

New D.I.C Head
Group Icon

Joined: 23 Jan, 2006
Posts: 40



Thanked: 1 times
Dream Kudos: 100
My Contributions
QUOTE(no2pencil @ 24 Aug, 2007 - 09:36 AM) *

I don't think that the html level is where you should conduct network connection testing. Even if the webserver is on the local network, should the web service on the server be down (not running, stalled, timed out) then the page will fail. Are you wanting to test the network connection of the client to the webserver, the existance of the webserver (as seen by the client), or the network connection of the webserver to the client?

<edit>
These referances should shed some light:
http://www.webopedia.com/quick_ref/OSI_Layers.asp
IPB Image
</edit>


i want to test the network connection on the client itself.....that is if the client has a valid internet connection at a perticular time!!......and i dont understand why you showed me the osi model??i know what an osi model is.......its just i didnt understand what u r tryin to imply.....can u explain more in detail
User is offlineProfile CardPM
+Quote Post

no2pencil

RE: Check Network Connection

24 Aug, 2007 - 08:56 AM
Post #5

i R L33t Skiddie, k?
Group Icon

Joined: 10 May, 2007
Posts: 13,499



Thanked: 303 times
Dream Kudos: 2875
Expert In: Goofing Off

My Contributions
QUOTE

i want to test the network connection on the client itself.....that is if the client has a valid internet connection at a perticular time!!

Windows: use the Task Schedular to launch nslookup & traceroute, log the results
Linux : create a crontab to perform nslookup & trecroute, again, log the results

QUOTE

......and i dont understand why you showed me the osi model??i know what an osi model is.......its just i didnt understand what u r tryin to imply.....can u explain more in detail

The client requesting an HTML connection/site is at the application level. When the webserver receives that request, & answers it, it is again, at the application level. That leaves six other levels for error, as well as the server itself, not running. So you would not want to issue a test (if it were even possible) using Javascript, because that's at the application level & can give you a WORLD of invalid (not true) failure results.

User is online!Profile CardPM
+Quote Post

devangnegandhi

RE: Check Network Connection

24 Aug, 2007 - 09:01 AM
Post #6

New D.I.C Head
Group Icon

Joined: 23 Jan, 2006
Posts: 40



Thanked: 1 times
Dream Kudos: 100
My Contributions
k....thanks
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 06:00PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month