Results 1 to 3 of 3

Thread: [RESOLVED] [2008] server/client TCP, help!

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    Resolved [RESOLVED] [2008] server/client TCP, help!

    hey guys,
    Alright so I went to the codebank and used the basic TCP communication.

    It dosnt work . WHen I click listen on my computer and then go up to my laptop which is connected to a DIFFERENT NETWORK ( i am stealing my neighbours wireless hehe) it dosnt connect.

    The error message says:
    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.12.133.107:664
    My understanding is that IT DOES CONNECT but my server has problems. Anyway read on to what I think might be causing a problem.

    I think the problem might lie here:
    Code:
    listener = New System.Net.Sockets.TcpListener(System.Net.IPAddress.Any, CInt(txtPort.Text)) 'The TcpListener will listen for incoming connections at port 43001
    MSDN Says

    Create a TcpListener using an IPEndPoint, a Local IP address and port number, or just a port number. Specify Any for the local IP address
    But none of this is local. Its over the internet.

    Secondaly I think you guys should know this, ( i dont know if all the modems do this)

    but my highspeed modem gives me a "local" IP. when i do ipconfig it gives me a 192.168.2.1. When I plug this in in to IE, i get a web based modem configuration thing which shows my REAL IP.

    could that be a problem?

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    Re: [2008] server/client TCP, help!

    ALright i think i found a solution
    http://www.vbforums.com/showthread.php?t=506751

    vb Code:
    1. Fixed this!
    2.  
    3. The problem was that TcpListener can't listen on an external (or WAN) IP. For anyone else who has this problem (with a router):
    4.  
    5. You need to
    6.  
    7. 1. Have your tcpListener listen on your computer's local IP, and a specified port.
    8. 2. Set up your router to forward incoming requests for that port to your computers IP.
    9. 3. Have your TcpClient or Socket connect to your WAN IP, and the same port number.

    but I dont have a router. its modem to computer directly.
    note: like my last post, this laptop is connected through neighbors wireless

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    Re: [2008] server/client TCP, help!

    I downloaded a program which allowed me to forward the incoming connection from port xx WAN IP to port xx INTERNAL IP.

    The program is called Vista Firewall Control.

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