CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 34

Threaded View

  1. #27
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Winsock and File Transfers

    Quote Originally Posted by Murjax View Post
    I'm a little confused now. I fixed the port mistake, but I don't quite get what you mean when you say there's something wrong with my IP. I AM supposed to be listening on the localhost correct? The way I have it setup my server listens on the localhost and the client connects to it via the server's remote IP.
    The client would use the address of the server. If your server address is 127.0.0.1 as in your example above then your client would have to use 127.0.0.1

    For example If you want to connect to Google you will not get there by typing in Yahoo.

    Btw you can also use the machine name rather than a hard coded IP address. Works much better especially when the IP is DHCP controlled.

    Code:
    Dim hInfo As IPHostEntry = Nothing
    Dim hIPAddress As IPAddress = Nothing
    hInfo = Dns.GetHostEntry("Machine Name Here")
    hIPAddress = hInfo.AddressList(0)
    Last edited by DataMiser; July 27th, 2010 at 07:35 PM.
    Always use [code][/code] tags when posting code.

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

Featured