Results 1 to 40 of 46

Thread: [RESOLVED] Self Test TCP Client Server Connection

Threaded View

  1. #1

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Resolved [RESOLVED] Self Test TCP Client Server Connection

    Hi,

    I made a server app and a client app from the post in Atheist's signature (TCP client/server connection ).
    Then I tried to run both on my machine, as a self test.
    However the results were not as expected.

    The server runs fine.

    The client runs fine when I put IP Address 127.0.0.1, but errors out when I put my actual internet IP address.

    VB.NET Code:
    1. Private client As System.Net.Sockets.TcpClient
    2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    3.     client = New System.Net.Sockets.TcpClient("122.162.75.237", 43001)  '<-- Error: SocketException - No connection could be made because the target machine actively refused it 122.162.75.237:43001
    4.     client.GetStream.BeginRead(readBuffer, 0, BYTES_TO_READ, AddressOf doRead, Nothing)
    5. End Sub


    The IP address I put there is what I can see myself from many sites like www.whatismyip.com etc.
    I also tried a ping on that address and it returns fine.

    What could be the reason?

    Pradeep
    Last edited by Pradeep1210; Nov 18th, 2008 at 02:35 PM.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

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