Results 1 to 4 of 4

Thread: Checking Whether Server Is Online/Offline

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    95

    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..

  2. #2
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    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.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    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
  •  



Click Here to Expand Forum to Full Width