Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Winsock woes

I am writing (already wrote) an application that attempts to connect two or more computers together using Winsock in the Server/Client mode. I wrote to seperate applications one that acts as the Server and the other that acts as the Client. I tested the application out on my own computer (as I only have one pc) and the Client app is able to connect to the Server and send data back and forth. At first I used the 127.0.0.1 IP address, then later changed that to my actual IP address, both worked when running both the Server and Client app on my own PC. Ok, on to the big test. I gave my Client app to someone to run on their home computer and made sure my Server app was up and running. They couldn't connect to my computer. Any idea on what could be going on? Any way to do some kind of ping test in VB between computers? Suggestions?

vr

Xeifrank

Comments

  • jlegjleg Member Posts: 237
    : I am writing (already wrote) an application that attempts to connect two or more computers together using Winsock in the Server/Client mode. I wrote to seperate applications one that acts as the Server and the other that acts as the Client. I tested the application out on my own computer (as I only have one pc) and the Client app is able to connect to the Server and send data back and forth. At first I used the 127.0.0.1 IP address, then later changed that to my actual IP address, both worked when running both the Server and Client app on my own PC. Ok, on to the big test. I gave my Client app to someone to run on their home computer and made sure my Server app was up and running. They couldn't connect to my computer. Any idea on what could be going on? Any way to do some kind of ping test in VB between computers? Suggestions?
    :
    : vr

    I suppose the first question to ask is, is the Client in the same network as you? 2. Can your Client ping your computer from the command prompt? 3. Are you or your client behind a router or a firewall?

    For your information 127.0.0.1 is a local host address it will always loop back to yourself.

    John
    :
    : Xeifrank
    :
    :

  • xeifrankxeifrank Member Posts: 55
    Yes, I have a wireless router. I suppose I need to find the routers IP, instead of my own. Is there any particuliar port that would give me better results.

    thanks,

    Xeifrankie
  • jlegjleg Member Posts: 237
    : Yes, I have a wireless router. I suppose I need to find the routers IP, instead of my own. Is there any particuliar port that would give me better results.
    :
    : thanks,
    :
    : Xeifrankie
    :
    OK

    Most routers will perform two tasks that will hinder your client being able to contact your server app.

    1. NAT, your internal address is not presented to the internet. It is an internal, non routeable address. In other words private. eg: 192.168.1.50. You will not be able to target this address directly from an external source.

    2. Firewall, the port you may be using for your server or listening port may be blocked and therefore not accessable from the internet.

    To cure these problems you need to create a passthrough or redirected port in your router. You need to know what the listening port is to specify it. Most routers will ask, What ip address is the host ("this is your network address" eg: 192.168.1.50, what port and type do you want to redirect eg: 4101 TCP.) It is also an advantage to have a static IP address within your own network. This means that your computer will not change its address if using DHCP. You will always be at the same place

    So how this works is, you need to give your client your routers external address (static IP is much better for this type of app.) eg" 203.12.160.88, this is the address that is present on the internet. When you have created a redirection in your router any traffic on the port specified is redirected to your computer 192.168.1.50.

    You need to make sure that you do not have a firewall that will stop traffic on this port or it still wont work

    He needs to be able to ping your routers IP address to make sure that it is available on the internet. Once you are sure that your router is accessable you need to try your app again after these alterations to the router have been made.

    Hope this helps

    John ;-)

    PS: Your client also has to make sure that his sending and listening ports are not blocked by a firewall. It is "NOT" normally necessary for your client to redirect his ports.


Sign In or Register to comment.