sendto: Network unreachable

前端 未结 2 1500
南旧
南旧 2021-01-15 15:59

I have two machines I\'m testing my code on, one works fine, the other I\'m having some problems and I don\'t know why it is.

I\'m using an object (C++) for the netw

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-15 16:55

    Few things to check 1. Run the server. Use netstat and see the IP and the port that the server is bound to. Is the IP a localhost IP or the 0.0.0.0 IP ? 2. Once you know that the server is listening on the right port and that the address is fine, check if you can telnet to the port. Just try this telnet 3. This will attempt a connection to the port (doesn't matter that it is not a telnet server, you can use this to check connectivity) 4. If telnet is able to connect to the port i.e. no errors, you can then check the client code to see what you are missing. And like Glen mentioned, did you check you are able to make remote connections from the client machine ?

提交回复
热议问题