Solved

How to find out, if I'm online

Posted on 2002-03-20
8
186 Views
Last Modified: 2010-03-31
Is there a method in the API to find out, if I'm currently connected to the internet ?

thx,

Ben Utzer
0
Comment
Question by:benutzername
8 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 6882245
What do you mean with "connected to the internet"?
0
 

Expert Comment

by:Pecos
ID: 6883509
Write your own..
You can choose a dependable address out there on the net (say some pop3 server).  Then you can try to open a socket connection to port 23 (or is that for ftp? no matter).  If it opens, then you're good to go.

You can also try to just ping something (yahoo.com).
0
 
LVL 1

Expert Comment

by:saurav17
ID: 6885020

hi benutzername,

As Pecos has said try  pinging websites
no other go.

as pecos said writting socket program to pop3 server u need to know the prtno., 23 is not default port for pop3 servers. It depends on what administrators choose. The best way is pinging or keep refreshing ur webpage or webcomponents like messengers by hiiting F5.


Regards,
K.J.S.
0
 
LVL 2

Expert Comment

by:coreyit
ID: 6888066
saurav17,

Perhaps you should take a look at the tips at the bottom of this page. Especially the "...and doesn't duplicate a previous comment" part.

-corey
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:benutzername
ID: 6889152
>Is there a method in the API to find out, if I'm currently connected to the internet ?

Sorry guys, pinging a website is an obvious soloution and was my first idea, too, so there won't be any points for that idea...

I was looking for something like java.net.isOnline() ... so a profound "no, you gotta do it yourself" would've been worth 50 points to me.

Never mind,

Ben Utzer
0
 

Accepted Solution

by:
Pecos earned 50 total points
ID: 6889606
Oh.. I guess my first line "Write your own.." isn't anything like "no, you gotta do it yourself."
:)
0
 

Author Comment

by:benutzername
ID: 6890207
ok, take them if you want them
0
 

Author Comment

by:benutzername
ID: 6890208
ok, take them if you want them
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now