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?
:cool:
Re: Simple TCP/IP Winsock Issue
Quote:
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.
Quote:
.. 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.