Sign in to follow this  
Followers 0
AzKay

Ping

6 posts in this topic

With the "ping" command, it only seems to work, if I add a symbol on the end of the site.

Ping("www.google.com")
If @error = 0 Then
    MsgBox(0, "", "Offline")
Else
    MsgBox(0, "", "Online")
EndIf

If I try ping that, it reads offline, but if I make it .com: or .com/ it works.

Not my question though.

Is there a function to check the server, but through a specific port? Liek, If I wanted to check the status of a game server, eg, login server character server & map server, I would have to ping the same server, but at 3 different ports.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

With the "ping" command, it only seems to work, if I add a symbol on the end of the site.

Ping("www.google.com")
If @error = 0 Then
    MsgBox(0, "", "Offline")
Else
    MsgBox(0, "", "Online")
EndIf
oÝ÷ Øȶ¼©x-«b¶·vÊ~X§y»­ò&jG¢µÊ&¢·(ø­Âä°Ú-*®zËb¢{a¢è!þ«¨µá+®

For your second question: The TCP... functions should be able to initial a connection to a specific port to test the availability of the function.

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ooo, thanks ^^


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

I tryed TCPConnect(), Doesnt seem to connect, "Wrong port" or something.

If trying to connect:

64.233.187.99:80 which is google.be on port 80, I know its right, because I sniffed it. Any ideas?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

I tryed TCPConnect(), Doesnt seem to connect, "Wrong port" or something.

If trying to connect:

64.233.187.99:80 which is google.be on port 80, I know its right, because I sniffed it. Any ideas?

Maybe show what you have coded ?

This seems to work fine:

$server = "64.233.187.99"
$port = "80"
Ping($server)
If @error Then
    MsgBox(0, "", "Offline")
Else
    $rc = TCPStartup()
    $rc = TCPConnect($server,$port)
    $Err = @error
    If $rc = -1 Then 
        MsgBox(0, "Cannot connect", "Cannot connect Error:" & $Err )
    Else
        MsgBox(0, "Service OK","Service OK" )
    EndIf
    TCPShutdown() 
EndIf

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Works, hehe


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0