Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problem with using TCP connecting  (Read 6645 times)

0 Members and 1 Guest are viewing this topic.

tokiwotomare

  • Newbie
  • *
  • Posts: 21
    • View Profile
Problem with using TCP connecting
« Reply #15 on: April 09, 2011, 08:27:38 pm »
Quote
Can it be caused that I dont have a public IP?


If I'm understanding the question right -- no. If you're connected to the internet, you have a public (outward-facing) IP address. You said earlier:

Quote
And my second question is why it doesnt work when I write the IP from whatismyip.com as ServerAddress.


That IP is your public IP. What Laurent is saying is that if you intend to use that IP address to connect, you need to forward ports. What's essentially happening (in a very small nutshell) is this:

- Your computer issues a request for 178.41.66.24.
- Your router says "That's outside our network!" and sends it off to a DNS service.
- The DNS service sends the packet to 178.41.66.24, which, as it happens, is your router.
- Your router gets it and says "Okay, which machine does this go to?" To answer that question, it looks at what port it's coming in on and its port forwarding rules. Every router has port forwarding rules.
- You provide (I'm assuming) port 4567 as the port. Your router looks at its port forwarding rules and says "I don't have a rule for this." Since it doesn't know where to send it, it drops the packet (unless it has some default rule defined).

It's easier to use your local IP address for testing, because you (usually) don't have to configure your router at all. If you're running it from the same machine, you can use localhost (127.0.0.1) as the IP address. If you're targeting a different machine on your network, you'll need its local address, which you can find by typing "ipconfig" in your command prompt (or "ifconfig" if you're using a Linux-based OS).

If you really, really want to use your public IP address, you'll have to Google the instructions for setting up port forwarding with your router (or use UPNP, but I wouldn't suggest that until you learn some basic networking!).

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Problem with using TCP connecting
« Reply #16 on: April 09, 2011, 09:28:40 pm »
Thanks for this  :D I understand now