|
-
May 2nd, 2008, 05:49 PM
#1
Thread Starter
Lively Member
Checking Whether Server Is Online/Offline
How do i code it in vb 6.0 so when i click "Check Status" it will either display the server as online or offline, providing the ip and port aswell..
-
May 2nd, 2008, 09:52 PM
#2
Fanatic Member
Re: Checking Whether Server Is Online/Offline
You could ping the server using API or an external program.
I don't know what you mean by port? Either the server is up or not.
Some servers do block ping, but that is the only "reliable" thing to tell if a server is online.
-
May 3rd, 2008, 04:51 AM
#3
Re: Checking Whether Server Is Online/Offline
Pinging is the way I would go.
An alternative would be to simply try an access a resource on it. If you can't, it will generate an error, which you would trap.
-
May 3rd, 2008, 04:39 PM
#4
Re: Checking Whether Server Is Online/Offline
If it's a server it should already have a port open that it uses. If connecting to that port fails, the server is not online. The computer running it might be. If the error message is something like "Connection forcefully rejected" then the computer is online but the server is not running. If the connection fails due to timeout then chances are the computer itself is not online.
So it depends really on what you're wanting to know...a normal ICMP ping might be the best bet to see if the actual computer is online, or a connection attempt to the server to see if the server software is running.
For the connection attempt you can use the Winsock control or its API (or the CSocketMaster class) since just attempting to connect doesn't warrant the dependency of the Winsock OCX control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|