Connection timed out

Using C # I am trying to send messages to a server. However, I am getting socket exception 10060 which indicates a connection timed out error. What could be the problem?

0


a source to share


3 answers


Check that the application on your server is up and running. Dual check address and port. Make sure your firewall allows connections of the type you are trying to make.



The simplest way would probably be to use telnet and see if you can connect.

+1


a source


Maybe the server is not listening on the specified port or is not accepting the connection. This could be due to a firewall (software or hardware).

I would check the server connection with a third party app. For example, just telnet to a host on a given port (if it's a TCP connection) and check if the connection is up.



On the server, you can run netstat -na

(in windows) to see if there is anything listening on the target port.

0


a source


Go to your computer and use telnet locally:

telnet localhost yourportnumberhere

      

... if you don't get a connection, forget about firewalls - you're just not listening on that port.

If that works, go back from your computer to one on the network and try again. If that fails, it is the firewall on the computer that is blocking it.

If that works, use the same telnet command on your computer (or at least the one that runs the code that tries to connect)

0


a source







All Articles