locked
TCP socket problem RRS feed

  • Question

  • hello

    i work in my project  email security service ; i made  two program client and server windows form i connect tow program by tcp socket when i work in the same pc the program run correct

    but when connect server in pc and client in another pc i face problem in socket because i make my program take ip of server   danmic from router  in connection pc server now when send packet i but the same ip of pc server in pc client but no connection and problem appear

    Sunday, July 24, 2016 7:10 PM

Answers

  • 1. Your apps have to use appropriate IP addresses for connecting to remote location.

    2. As DA924x mentions you may have a firewall issue on either PC. You may either need to turn off the firewalls or set them to allow your application to run on the PC in question.

    3. You can download for free WireShark an open source network sniffer to monitor you network to see what your applications are doing with regard to the packets they are sending. It will take time to learn how to use it.

    4. You should not hard code IP addresses to use in your app. Use a TextBox to either provide the IP address from or get the IP address(es) of the host name typed in the TextBox and figure out which one returned your app should use to connect to the host.

    Also see;

    Dns.GetHostAddresses Method (String)

    Dns.GetHostEntry Method (String)

    Host Names and IP Addresses


    La vida loca

    Sunday, July 24, 2016 11:00 PM

All replies

  • It sounds like a firewall is running on the pc hosting the server that is blocking the initial contact from the PC running the client. Turn off the firewall on the server machine so the client can make the contact with the server.
    Sunday, July 24, 2016 8:03 PM
  • 1. Your apps have to use appropriate IP addresses for connecting to remote location.

    2. As DA924x mentions you may have a firewall issue on either PC. You may either need to turn off the firewalls or set them to allow your application to run on the PC in question.

    3. You can download for free WireShark an open source network sniffer to monitor you network to see what your applications are doing with regard to the packets they are sending. It will take time to learn how to use it.

    4. You should not hard code IP addresses to use in your app. Use a TextBox to either provide the IP address from or get the IP address(es) of the host name typed in the TextBox and figure out which one returned your app should use to connect to the host.

    Also see;

    Dns.GetHostAddresses Method (String)

    Dns.GetHostEntry Method (String)

    Host Names and IP Addresses


    La vida loca

    Sunday, July 24, 2016 11:00 PM