Page 1 of 2 12 LastLast
Results 1 to 40 of 46

Thread: [RESOLVED] Self Test TCP Client Server Connection

  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...

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Are you behind a router? Have you forwarded the port?
    Are you running any firewalls?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

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

    Re: Self Test TCP Client Server Connection

    The firewall is turned off temporarily.
    I am using ADSL2+ Modem.
    How to find out whether you forwarded the port?
    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...

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    If you dont know if you have, you probably havent. What router have you got?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  5. #5

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

    Re: Self Test TCP Client Server Connection

    It's Beetel 220BX, ADSL2+ Modem
    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...

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Have a look at this.
    The public IP reported from whatismyip.com isnt your computers external IP, but your routers. When you connect to that IP on that specific port (43001), you must tell the router to forward the connection to your computer. This is why you need to do port forwarding.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  7. #7

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

    Re: Self Test TCP Client Server Connection

    Thanks a lot Atheist.

    I'll just try that and report back about it in this thread.

    Pradeep
    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...

  8. #8

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

    Re: Self Test TCP Client Server Connection

    Unfortunately, it requires static IP for port forwarding. I have a connection with dynamic IP. I contacted my ISP and came to know that they charge a hefty amount to provide connections with static IP address

    Is there no way to receive incomming connections without that??
    I wonder how other applications like yahoo messenger etc. are managing this? They don't require me any configuration.


    Pradeep
    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...

  9. #9
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Just use your computers local ip that you find if you run the ipconfig command in the command prompt
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  10. #10
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    With your other everyday application, you usually are the client that connects to servers out in the world. In this case you're running the server, and so a little configuration needs to be made.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  11. #11

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

    Re: Self Test TCP Client Server Connection

    That works fine... but I assume it is just equivalent of 127.0.0.1, i.e. connecting locally without thru the internet.

    Will someone be able to connect to my PC thru the internet to my PC with that IP address?

    Pradeep
    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...

  12. #12
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Quote Originally Posted by Pradeep1210
    That works fine... but I assume it is just equivalent of 127.0.0.1, i.e. connecting locally without thru the internet.
    How do you mean? You didnt enter 127.0.0.1 in the port forwarding did you?

    Quote Originally Posted by Pradeep1210
    Will someone be able to connect to my PC thru the internet to my PC with that IP address?
    If the port forwarding is setup properly and you're running the server then yes indeed!
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  13. #13

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

    Re: Self Test TCP Client Server Connection

    Quote Originally Posted by Atheist
    With your other everyday application, you usually are the client that connects to servers out in the world. In this case you're running the server, and so a little configuration needs to be made.
    Many a times I find my firewall reporting that a particular application is trying to act as server (especially yahoo messenger). They work fine.

    Also P2P programs work just fine. How do they manage that thing?


    Pradeep
    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...

  14. #14

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

    Re: Self Test TCP Client Server Connection

    Quote Originally Posted by Atheist
    How do you mean? You didnt enter 127.0.0.1 in the port forwarding did you?


    If the port forwarding is setup properly and you're running the server then yes indeed!
    My local IP address is 192.168.1.2.
    The client program works fine with my local IP address and 127.0.0.1
    It fails only when I want to connect using my extenal IP address. (i.e. 122.162.75.237 at present)

    I wanted to give the client program to someone else whom I want to connect to my PC. Then give my external IP address over phone whenever he needs to connect to my PC (since it is a dynamic connection and IP address will change each time)
    So I doubt if I'm not able to connect thru my external IP address, he won't be able to connect either.

    Pradeep
    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...

  15. #15
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Many applications these days uses TCP to communicate between processes or even within the same process, that might or might not be what is going on when an application is trying to act as a server.

    P2P is an whole technology on its own, way to advanced to summarize in one single post

    Many large companies have advanced solutions to work around the problem of port forwarding. Skype for example uses intermediate "master-servers" to allow one person to initiate a connection with someone else.

    Though you'll find that port forwarding is still needed. The BitTorrent technology for example requires port forwarding for maximum efficiency. Setting up a private dedicated server in CSS also requires port forwarding.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  16. #16
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Quote Originally Posted by Pradeep1210
    My local IP address is 192.168.1.2.
    The client program works fine with my local IP address and 127.0.0.1
    It fails only when I want to connect using my extenal IP address. (i.e. 122.162.75.237 at present)

    I wanted to give the client program to someone else whom I want to connect to my PC. Then give my external IP address over phone whenever he needs to connect to my PC (since it is a dynamic connection and IP address will change each time)
    So I doubt if I'm not able to connect thru my external IP address, he won't be able to connect either.

    Pradeep
    Thats right. But by fowarding the port 43001 to your local IP, the router will forward any incoming traffic to your computer, as long as your local IP stays the same.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  17. #17

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

    Re: Self Test TCP Client Server Connection

    But the local IP as well as the external IP changes everytime the modem is reset.

    What should I do?
    Is there some way to setup peer to peer connection since client-server is not exactly what I require. And will that get me rid of that port forwarding setup?
    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...

  18. #18
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    The external IP changing is, as you've found, nothing you can do anything about unless you pay your ISP a rude amount of money. You could use no-ip.com to give your external IP a static hostname.
    Making your local IP static is not hard, read this.

    Peer to peer isnt as "peer-to-peer" as it sounds, you still have to have one host listening for a connection and one host actively connecting to the listening host. Creating a pure peer to peer network defenitely isnt an easy task.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  19. #19

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

    Re: Self Test TCP Client Server Connection

    Thanks

    Seems like that will solve my problem.

    Pradeep
    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...

  20. #20
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    I hope it works out for you
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  21. #21

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

    Re: Self Test TCP Client Server Connection

    I assigned a fixed local IP address and then configured my router for port forwarding with local IP address.

    But still I can access it using the local IP or 127.0.0.1 but not with my external IP address.

    So the problem is still the same. How should I let the anyone connect to my PC thru the internet?

    Please have a look at the screenshot. Maybe I have messed up something. I had assigned static local IP address 192.168.1.11
    Attached Images Attached Images  
    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...

  22. #22
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    What happens when you try to connect to your server using the external IP?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  23. #23

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

    Re: Self Test TCP Client Server Connection

    Quote Originally Posted by Atheist
    What happens when you try to connect to your server using the external IP?
    I get the same error I was getting before.
    "No connection could be made because the target machine actively refused it"

    But there is no error if I replace the IP address with 192.168.1.11 or 127.0.0.1

    .
    Attached Images Attached Images  
    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...

  24. #24
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Very odd. Have you tried resetting your router? It should forward the connection to your computer. I take it you've doublechecked everything; the external IP you're trying to connect to, the local IP you supplied in the router, etc.?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  25. #25
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    this sounds like a nat traversal problem.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  26. #26
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    q's
    you have assigned your "server" a static ip?
    you have registered at no-ip or dyndns?

    if so try changing the port to 80(if you are running IIS you'll need to turn it off). this will only work if your isp is not blocking port 80.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  27. #27

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

    Re: Self Test TCP Client Server Connection

    @Atheist:
    I have resetted the router many times and put the new external IP address. The error is same everytime. I just resetted the router again to confirm and the new IP address I got is 122.162.75.13. This too fails with the same error.

    @dbasnett
    I have assigned static local IP address in system settings only. No changes in code.
    This is how the server code goes (credits Atheist):
    vb Code:
    1. Public Sub New()
    2.     listener = New System.Net.Sockets.TcpListener(System.Net.IPAddress.Any, 43001) 'The TcpListener will listen for incoming connections at port 43001
    3.     listener.Start() 'Start listening.
    4.     listenThread = New System.Threading.Thread(AddressOf DoListen) 'This thread will run the doListen method
    5.     listenThread.IsBackground = True 'Since we dont want this thread to keep on running after the application closes, we set isBackground to true.
    6.     listenThread.Start() 'Start executing doListen on the worker thread.
    7.     RaiseEvent ServerStarted(43001)
    8. End Sub

    Pradeep
    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...

  28. #28

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

    Re: Self Test TCP Client Server Connection

    I registered at no-ip.com also. But that too seems to be of no help.
    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...

  29. #29
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  30. #30

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

    Re: Self Test TCP Client Server Connection

    I downloaded a NAT tester from a link in that wikipedia article. It gives the result as in the screenshot, but then crashes.

    Could this information be of any help?

    .
    Attached Images Attached Images  
    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...

  31. #31

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

    Re: Self Test TCP Client Server Connection

    Ahhhh..
    finally things moved.

    I got this error on my server application in the ConnectedClient class when I tried to probe the port from https://www.grc.com/x/portprobe=43001 I'm not much concerned about the error since that website might have done something wierd.
    But this confirms that the port is now open to the internet but for some reason or the other my client application is not able to connect to it.

    Here is the result of port probe:
    Code:
    ----------------------------------------------------------------------
    
    GRC Port Authority Report created on UTC: 2008-11-20 at 01:01:44
    
    Results from probe of port: 43001
    
        1 Ports Open
        0 Ports Closed
        0 Ports Stealth
    ---------------------
        1 Ports Tested
    
    THE PORT tested was found to be: OPEN.
    
    TruStealth: FAILED - NOT all tested ports were STEALTH,
                       - NO unsolicited packets were received,
                       - A PING REPLY (ICMP Echo) WAS RECEIVED.
    
    ----------------------------------------------------------------------
    Attached Images Attached Images  
    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...

  32. #32

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

    Re: Self Test TCP Client Server Connection

    What else could be the problem with my client app?
    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...

  33. #33
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Self Test TCP Client Server Connection

    Are you still completely unable to connect using the external IP? What about the last screenshot you posted, was that when you connected using the local ip?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  34. #34
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    is your client on the same network or is it somewhere on the internet?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  35. #35

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

    Re: Self Test TCP Client Server Connection

    I'm not having any issues using the local IP address or the localhost (127.0.0.1) ever since the beginning.
    I can't connect using the external IP, but port probe from various internet based software tell me that the port 43001 is open on my system. The screenshot I posted in the last is what I still get when trying to probe that port. That confirms that port is open. So what is the reason I can't connect using the external IP address using the TCPClient class?

    The client and server are on same machine (for testing).

    Pradeep
    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...

  36. #36
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    somewhere i saw a no hairpin statement.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  37. #37

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

    Re: Self Test TCP Client Server Connection

    Yes, screenshot in post #30. But I don't know what hairpin means or how to interpret those results.
    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...

  38. #38
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    that would be a hairpin(client / server on same machine). that is the first time i have seen it used in this context. i knew it from SONET and it was defined as the ability to send a signal from one drop port to another drop port without accessing the network.

    you need someone on the outside to connect to your port.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  39. #39

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

    Re: Self Test TCP Client Server Connection

    So how to get over this problem?
    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...

  40. #40
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Self Test TCP Client Server Connection

    i answered that. you need to take the client to the outside.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Page 1 of 2 12 LastLast

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