Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 02:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



TCP help

Discussion on TCP help within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
TCP help

Hi i have problem with connection to a server, when i try to connect it tell me that connection cant be established

i tried to ping that adress in cmd and it all fine

Code:
Opt("TCPTimeout", 100) ;100 milliseconds

TCPStartup()
$ip = TCPNameToIP("login.justac.net") ; = 192.200.116.253
$port = 11000
$socket = TCPConnect($ip, $port)

If $socket = -1 Then
	ToolTip("The connection to the server could not be established!", 0, 0)
Else
	ToolTip("Connection established", 0, 0)
EndIf

While 1
	Sleep(100)
WEnd
LiveLong23 is offline  
Old 02/06/2014, 20:17   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Probably the script got blocked by your firewall? Also Shutdown TCP again.
alpines is offline  
Old 02/06/2014, 20:20   #3
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
100 milliseconds ? some more will be ok because sometimes it takes some time if there are more connects on The server or some other things

Do you have admin rights ?
#RequireAdmin
In windows vista its needed often
YatoDev is offline  
Old 02/06/2014, 20:24   #4
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
Ah my bad i was need to connect to remote server i used it like this now and its works

Code:
Opt("TCPTimeout", 100) ;100 milliseconds

Local $ip = "login.justac.net"
Local $port = 11000

; Start The UDP Services
;==============================================
UDPStartup()

; Connect to a Listening "SOCKET"
;==============================================
Local $socket = UDPOpen($ip, $port)

If $socket = -1 Then
	ToolTip("Cant establish connection", 0, 0)
Else
	ToolTip("Connected", 0, 0)
EndIf

While 1
	Sleep(100)
WEnd
Do you know maybe how i can check current patch version in registry with patch on server
i have in registry like this

LiveLong23 is offline  
Old 02/06/2014, 20:24   #5
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
(My ping to that address is above 150ms so I recommend you to unset your Timeout or to set it to at least 300~500.)

Why did you try TCP first and not UDP if the server handles UDP?
alpines is offline  
Old 02/06/2014, 20:26   #6
 
elite*gold: 0
Join Date: Jan 2014
Posts: 43
Received Thanks: 1
im testing this first time so i forgot to read good in help file ;D

Open a socket connected to an existing server .
UDPOpen ( IPAddr, port [, flag] )
LiveLong23 is offline  
Reply




All times are GMT +1. The time now is 02:26.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.