Sign in to follow this  
Followers 0
Kip

TCP only works with @IPAddress1

33 posts in this topic

#1 ·  Posted (edited)

The title says the most: when i create a client that connects to @IPAddress1 it works fine,

But when I enter my ip address, so the client can connect to the server from others computers, it does nothing.

Weird? Or am i making a mistake somewhere?

Thnx, Kip

Edit: firewall is set to Ok, and the port is opened/forwarded. Tried 127.0.0.1 and 192.168.1.101, but still doesnt work

Edited by kip

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I have the same problem... :D

Edited by ludocus

Share this post


Link to post
Share on other sites

This is proably because your router is blocking anyone from outside the network to connect to the computer. Look in your router's manual for port fowarding.

Share this post


Link to post
Share on other sites

You'll proably want to enter the computer's internet IP, not the computer's network IP.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I know.

The ip entered in the client: "**.**.***.***"

and in the server: @IPAddress1 [i tried 127.0.0.1 too]

Edited by kip

Share this post


Link to post
Share on other sites

Are you trying to connect to a computer in your home network, or to a computer over the internet? This makes all the difference.

Share this post


Link to post
Share on other sites

im trying to connect from my computer to my computer, but that shouldnt make a difference. You can view a page from your own webserver too.

correct me when im wrong.

Share this post


Link to post
Share on other sites

That makes all the difference. I'll try to explain it.

When you connect to a PC over the internet, you use the internet IP.

When you connect to a PC in your network, you use the internal IP.

When you connect to your own PC, you use the internal IP or localhost (127.0.0.1).

If you use ANY other than those IP's it will not work. Trying to connect from your own PC to your own PC using the internet IP, simply won't work. The internet simply wasn't built to do that.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

ok, that makes sense. But how does the client know to which ip he has to connect to?

EDIT: got it:

#include <Inet.au3>

TCPStartup()



$Server_PublicIP = "**.**.***.***"
$Server_LocalIP = "192.168.1.101"

$PublicIP = _GetIP()

$ConnectTo_IP = $Server_PublicIP

If $PublicIP = $Server_PublicIP Then; You're in the same network
    
    $ConnectTo_IP = $Server_LocalIP
    
EndIf


; Connect to $ConnectTo_IP

MsgBox(0,"IP",$ConnectTo_IP)

TCPShutdown()
Edited by kip

Share this post


Link to post
Share on other sites

nop it doesn't.... :D

Share this post


Link to post
Share on other sites

What exactly doens't work? You guys can't connect to eachother?

Share this post


Link to post
Share on other sites

Could you provide a little more detail please. Are you connecting over the internet, are you connecting over a network or are you connecting to yourself?

Share this post


Link to post
Share on other sites

Kip I need you, could you come on msn?

Share this post


Link to post
Share on other sites

Router forward port to server IP ...

Server listens on it's @IPAddress1

Client connects to Router's IP

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

The client (Ludocus) is connecting to me(server) over the internet.

Server listening on @IPAddress1, and client is connecting to my router's ip (the one that _GetIP() on my pc returns)

Or Ludocus is doing something wrong (wouldnt be the first time :D )

Edited by kip

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

Its working on my sisters pc (in the network)! :D

You can try if its working by downloading these two files, and running Client.au3. I'll leave the server on for a view hours.

(all that you'll be seeing is a list of processes at my pc)

_TCP.au3

Edited by kip

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