什么可以连接的原因拒绝了错误? [英] What can be the reasons of connection refused errors?
问题描述
我想用C写一个服务器程序,
使用其他客户端,当我尝试通过端口2080连接比如我得到这个错误。
I'm trying to write a server program in C, using another client, I get this error when I try to connect through port 2080 for example.
connection refused
有什么可以这个错误的原因是什么?
What can be the reasons of this error?
推荐答案
有可能有很多原因,但最常见的是:
There could be many reasons, but the most common are:
-
该端口是不是在目标计算机上打开。
The port is not open on the destination machine.
该港口是在目标计算机上打开,但它挂起连接的积压满了。
The port is open on the destination machine, but its backlog of pending connections is full.
在客户端和服务器之间的防火墙阻止访问(也检查本地防火墙)。
A firewall between the client and server is blocking access (also check local firewalls).
检查防火墙和端口是开放后,使用telnet连接到IP /端口来测试连接。这将从您的应用程序的任何潜在的问题。
After checking for firewalls and that the port is open, use telnet to connect to the ip/port to test connectivity. This removes any potential issues from your application.
这篇关于什么可以连接的原因拒绝了错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!