Results 1 to 3 of 3

Thread: Simple TCP/IP Winsock Issue

  1. #1

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236

    Cool Simple TCP/IP Winsock Issue

    I'm new to Networking stuff but I've been programming VB for awhile.. basically here's what I got.

    I am working on a simple client/server program. The Server form stands up and waits for the Client to call it's IP address and it's port... So I start my client program up... it uses localhost as it's IP address or the 127.0.0.1 IP Address and connects to the Server... my question is....

    How do I figure out what my IP address is and what the IP Address is for the user connecting to me. Because that 127.0.0.1 is also in the book I'm referring to, meaning that's standing for all localhost connections. But I want to use a different computer to connect to my IP address, only I don't know my IP address... is there property or method that'll give me my IP address so I can install the Client software on another computer, enter in my REAL IP address and then connect the two forms?


  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    To find out what your IP-adress is, just simply run winipcfg (or ipconfig in win2k).

    It has been a while since I was coding network-thingies in VB, but I'm pretty sure there's a method called GetLocalIP (or something like that) and a GetRemoteIP for the Winsock-control.

  3. #3
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177

    Re: Simple TCP/IP Winsock Issue

    Originally posted by TheGoldenShogun
    I am working on a simple client/server program. The Server form stands up and waits for the Client to call it's IP address and it's port... So I start my client program up... it uses localhost as it's IP address or the 127.0.0.1 IP Address and connects to the Server.
    127.0.0.1 is the local loopback address. It is an address that tells the computer not to test its connections to another computer, but to test its own basic network setup. Data is passed within the local TCP/IP stack.

    .. my question is....

    How do I figure out what my IP address is and what the IP Address is for the user connecting to me. Because that 127.0.0.1 is also in the book I'm referring to, meaning that's standing for all localhost connections. But I want to use a different computer to connect to my IP address, only I don't know my IP address... is there property or method that'll give me my IP address so I can install the Client software on another computer, enter in my REAL IP address and then connect the two forms?
    As CreoN said, you can use ipconfig to get your ip address.

    There are some other details to consider.

    Is the client computer connecting to you on the internet or intranet (local network)?

    If the connection comes from a computer on the internet, you may have a problem if your isp uses DHCP and assigns you a different address every time you connect.

    If the connection is from a computer on the intranet, the client can use the server's pc name instead of its ip address. If the intranet is a peer-to-peer setup, you may need to create HOSTS files on all the PCs. See http://support.microsoft.com/support.../Q228/7/60.ASP and http://support.microsoft.com/support.../Q105/9/97.asp for info on HOSTS files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width