Jump to content

[Solved]_Pinging port Q


goldenix
 Share

Recommended Posts

Hiye.

I want to check if a game/login/site server is online. but how can ping the port?

This gives me error 4 [4 = Other errors]

$var = Ping("85.192.33.142:80",250)

If $var > 0 Then
    Msgbox(0,"Status","Site is Online, roundtrip was:" & $var)
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
EndIfoÝ÷ Ù8b²¯zÉzºè¯]

Edit: See post 4 For solution.

Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

You just need to increase the timeout on the ping:

$var = Ping("85.192.33.142",2000)
If $var > 0 Then
    Msgbox(0,"Status","Site is Online, roundtrip was:" & $var)
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
EndIfoÝ÷ Ø@ÈL   l¢Ø^­æ¬¢{'yö¢çZºÚ"µÍÌÍÝH[Ê  ][ÝÎ
KNLÌËM    ][ÝËL

Is because just like typing "Ping 85.192.33.142:80" into a cmd window, a port specification is not allowed on the end of the IP.

Edited by danwilli
Link to comment
Share on other sites

You just need to increase the timeout on the ping:

Is because just like typing "Ping 85.192.33.142:80" into a cmd window, a port specification is not allowed on the end of the IP.

oh looks like it was my firewall blocking me from pinging but i still need to ping specific port because the server has world server/ game server/ login server running on same ip but different ports.

Is there any other way to check it?

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

TCPStartup()
$timer = TimerInit()
If (TCPConnect("85.192.33.142", 80) <> -1) Then
    ;;server online
    MsgBox(0, "online", "ping:" & TimerDiff($timer))
Else
    ;;server offline
    MsgBox(0, "offline", "ping:" & TimerDiff($timer))
EndIf
TCPShutdown()

The ping part is not very accurate because it adds some time to the actual ping :)

Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

If (TCPConnect("85.192.33.142", 80) <> -1) Then
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...