TCP/IP 某些最常见的错误原因码 (errno)列表
对于在基于 UNIX 的环境中的 TCP/IP 用户,下表列出了某些最常见的错误原因码 (errno)。它不是完整的错误列表。可以在文件 /usr/include/sys/errno.h 中找到 Errno。针对每一种操作系统给出了errno 号码。
Errno |
|
说明 |
---|
EINTR | 4 | 4 | 4 | 4 | 4 | 系统调用中断。 |
EAGAIN | 11 | 11 | 11 | 11 | 11 | 资源临时不可用。 |
EBUSY | 16 | 16 | 16 | 16 | 16 | 资源正忙。 |
EMFILE | 24 | 24 | 24 | 24 | 24 | 每个进程文件描述符表已满。 |
EPIPE | 32 | 32 | 32 | 32 | 32 | 管道断开。 |
EADDRINUSE | 67 | 226 | 125 | 125 | 98 | 已经在使用指定的地址。 |
ENETDOWN | 69 | 228 | 127 | 127 | 100 | 网络已停止。 |
ENETUNREACH | 70 | 229 | 128 | 128 | 101 | 没有到达网络的可用路由。 |
ENETRESET | 71 | 230 | 129 | 129 | 102 | 重设时网络已卸下了连接。 |
ECONNRESET | 73 | 232 | 131 | 131 | 104 | 伙伴已重设了连接。 |
ENOBUFS | 74 | 233 | 132 | 132 | 105 | 系统中没有足够的缓冲区空间资源可用来完成调用。 |
ENOTCONN | 76 | 235 | 134 | 134 | 107 | 未连接套接字。 |
ETIMEDOUT | 78 | 238 | 145 | 145 | 110 | 连接超时。 |
ECONNREFUSED | 79 | 239 | 146 | 146 | 111 | 连接已被拒绝。若您正在尝试与数据库相连,则检查是否已成功启动了服务器上的数据库管理程序和 TCP/IP 协议支持。 若使用 SOCKS 协议支持,则还要确保在 SOCKS 服务器上已成功启动了 TCP/IP 协议支持。 |
EHOSTDOWN | 80 | 241 | 147 | 147 | 147 | 主机已停机。 |
EHOSTUNREACH | 81 | 242 | 148 | 148 | 113 | 没有到达主机的可用路由。 |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
对 于 OS/2 环境中的 TCP/IP 用户,下面的列表显示了最常见的 errno。它不是完整的错误列表。可以在文件 nerrno.h 中找到 Errno。此文件是 TCP/IP 产品包含文件的一部分。若尚未安装这些文件,则在您的系统上可能不会出现。errno 号码本身是用括号括起来的。
SOCEINTR (10003):系统调用被中断。 |
SOCEMFILE (10024):打开的文件太多。 |
SOCEPIPE (10032):管道被断开。 |
EADDRINUSE (10048):已经在使用指定的地址。 |
ENETDOWN (10050):网络已停止。 |
ENETUNREACH (10051):没有到达网络的可用路由。 |
ENETRESET (10052):重设时网络已卸下了连接。 |
SOCECONNABORTED (10053):软件导致连接异常中止。 |
ECONNRESET (10054):伙伴已重设了连接。 |
ENOBUFS (10055):无缓冲区空间可用。 |
ENOTCONN (10057):未连接套接字。 |
ETIMEDOUT (10060): 在进行连接之前,建立连接超时。 |
ECONNREFUSED (10061):连接已被拒绝。若您正在尝试与数据库相连,则检查是否已成功启动了服务器上的数据库管理程序和 TCP/IP 协议支持。 |
若使用 SOCKS 协议支持,则还要确保在 SOCKS 服务器上已成功启动了 TCP/IP 协议支持。 |
EHOSTDOWN (10064):主机已停机。 |
EHOSTUNREACH (10065):没有到达主机的可用路由。 |
SOCEOS2ERR (10100):OS/2 错误。 |
有关 OS/2 TCP/IP 通信错误的详情,参考 OS/2 TCP/IP 文档。 |
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
对 于 Windows 95、Windows 98 或 Windows NT 下的 TCP/IP 或 IPX/SPX 用户,下面的列表显示了最常见的错误码。它不是完整的错误列表。可以在文件 winsock.h 中找到由 WSAGetLastError() 返回的错误。
WSAEINVAL (10022):若在函数 WSASTARTUP 上接收到此错误,则此 DLL 不支持应用程序所支持的 Windows Sockets 版本。 |
WSAEMFILE (10024):没有可用的文件描述符。 |
WSAEWOULDBLOCK (10035):套接字标记为未分块,而操作将分块。 |
WSAEINPROGRESS (10036):正在进行分块 Windows Sockets 操作。 |
WSAENOPROTOOPT (10042):该选项是未知的或不受支持的。 |
WSAEADDRINUSE (10048):已经在使用指定的地址。 |
WSAENETDOWN (10050):网络子系统已失败。 |
WSAENETUNREACH (10051):此时不能从此主机到达网络。 |
WSAENETRESET (10052):由于重设了远程主机,所以连接已断开。 |
WSAECONNABORTED (10053):由于超时或其他故障,导致虚拟电路异常中止。重设时网络已卸下了连接。 |
WSAECONNRESET (10054):伙伴已重设了连接。 |
WSAENOBUFS (10055):无缓冲区空间可用,连接太多。 |
WSAENOTCONN (10057):未连接套接字。 |
WSAETIMEDOUT (10060):在进行连接之前,建立连接超时。 |
WSAECONNREFUSED (10061):连接已被拒绝。若您正在尝试与数据库相连,则检查在服务器上是否已成功启动了数据库管理程序和 TCP/IP 协议支持。 |
WSAEHOSTUNREACH (10065):此时不能从此主机到达网络。 |
WSASYSNOTREADY (10091):基础网络子系统未准备好进行网络通信。 |
WSAVERNOTSUPPORTED (10092):此特定的 Windows Sockets 实现未提供请求的 Windows Sockets API 支持的版本。 |
WSAHOST_NOT_FOUND (11001):找不到主机。 |
WSATRY_AGAIN (11002):找不到主机。请求从名称服务器中检索主机名的 IP 地址失败。 |
WSANO_DATA (11004):名称无效,没有请求的类型的数据记录。名称服务器或 hosts 文件不识别主机名,或者在 services 文件中未指定服务名。 |
有关 Windows 下的 TCP/IP 通信错误的详情,参考 Windows Sockets 文档。 |
而我们可以通过以下代码来查看errno错误:
#include <errno.h> printf ("errno is: %d\n", errno);
strerror(errno):获取errno对应的错误
/****************************获取错误代码描述**************/
#include <string.h> /* for strerror */
#include <errno.h>
#include <stdio.h>
int main(int argc, char ** argv) {
int i = 0;
for(i = 0; i < 256; i++)
printf("errno.%02d is: %s/n", i, strerror(i));
return 0;
}
/*****************************************************************/
errno.00 is: Success
errno.01 is: Operation not permitted
errno.02 is: No such file or directory
errno.03 is: No such process
errno.04 is: Interrupted system call
errno.05 is: Input/output error
errno.06 is: No such device or address
errno.07 is: Argument list too long
errno.08 is: Exec format error
errno.09 is: Bad file descriptor
errno.10 is: No child processes
errno.11 is: Resource temporarily unavailable[资源临时不可用](连续发送数据时候回出此错,加延时)
errno.12 is: Cannot allocate memory
errno.13 is: Permission denied
errno.14 is: Bad address
errno.15 is: Block device required
errno.16 is: Device or resource busy
errno.17 is: File exists
errno.18 is: Invalid cross-device link
errno.19 is: No such device
errno.20 is: Not a directory
errno.21 is: Is a directory
errno.22 is: Invalid argument
errno.23 is: Too many open files in system
errno.24 is: Too many open files
errno.25 is: Inappropriate ioctl for device
errno.26 is: Text file busy
errno.27 is: File too large
errno.28 is: No space left on device
errno.29 is: Illegal seek
errno.30 is: Read-only file system
errno.31 is: Too many links
errno.32 is: Broken pipe[断开的管道](原因:the broken pipe error occurs if one end of the
TCP socket closes connection(using disconnect) or gets killed and the other
end tries to still write to it. An indication of a closed/terminated
connection is a return value of 0 when you try to read from that socket
using recv. After receiving such an error, if you try to still write to the
socket, your process gets sent the SIGPIPE signal which kills it.
)
errno.33 is: Numerical argument out of domain
errno.34 is: Numerical result out of range
errno.35 is: Resource deadlock avoided
errno.36 is: File name too long
errno.37 is: No locks available
errno.38 is: Function not implemented
errno.39 is: Directory not empty
errno.40 is: Too many levels of symbolic links
errno.41 is: Unknown error 41
errno.42 is: No message of desired type
errno.43 is: Identifier removed
errno.44 is: Channel number out of range
errno.45 is: Level 2 not synchronized
errno.46 is: Level 3 halted
errno.47 is: Level 3 reset
errno.48 is: Link number out of range
errno.49 is: Protocol driver not attached
errno.50 is: No CSI structure available
errno.51 is: Level 2 halted
errno.52 is: Invalid exchange
errno.53 is: Invalid request descriptor
errno.54 is: Exchange full
errno.55 is: No anode
errno.56 is: Invalid request code
errno.57 is: Invalid slot
errno.58 is: Unknown error 58
errno.59 is: Bad font file format
errno.60 is: Device not a stream
errno.61 is: No data available
errno.62 is: Timer expired
errno.63 is: Out of streams resources
errno.64 is: Machine is not on the network
errno.65 is: Package not installed
errno.66 is: Object is remote
errno.67 is: Link has been severed
errno.68 is: Advertise error
errno.69 is: Srmount error
errno.70 is: Communication error on send
errno.71 is: Protocol error
errno.72 is: Multihop attempted
errno.73 is: RFS specific error
errno.74 is: Bad message
errno.75 is: Value too large for defined data type
errno.76 is: Name not unique on network
errno.77 is: File descriptor in bad state
errno.78 is: Remote address changed
errno.79 is: Can not access a needed shared library
errno.80 is: Accessing a corrupted shared library
errno.81 is: .lib section in a.out corrupted
errno.82 is: Attempting to link in too many shared libraries
errno.83 is: Cannot exec a shared library directly
errno.84 is: Invalid or incomplete multibyte or wide character
errno.85 is: Interrupted system call should be restarted
errno.86 is: Streams pipe error
errno.87 is: Too many users
errno.88 is: Socket operation on non-socket
errno.89 is: Destination address required
errno.90 is: Message too long
errno.91 is: Protocol wrong type for socket
errno.92 is: Protocol not available
errno.93 is: Protocol not supported
errno.94 is: Socket type not supported
errno.95 is: Operation not supported
errno.96 is: Protocol family not supported
errno.97 is: Address family not supported by protocol
errno.98 is: Address already in use
errno.99 is: Cannot assign requested address
errno.100 is: Network is down
errno.101 is: Network is unreachable
errno.102 is: Network dropped connection on reset
errno.103 is: Software caused connection abort
errno.104 is: Connection reset by peer[l连接被对端重置]
errno.105 is: No buffer space available
errno.106 is: Transport endpoint is already connected
errno.107 is: Transport endpoint is not connected
errno.108 is: Cannot send after transport endpoint shutdown
errno.109 is: Too many references: cannot splice
errno.110 is: Connection timed out
errno.111 is: Connection refused
errno.112 is: Host is down
errno.113 is: No route to host
errno.114 is: Operation already in progress
errno.115 is: Operation now in progress
errno.116 is: Stale NFS file handle
errno.117 is: Structure needs cleaning
errno.118 is: Not a XENIX named type file
errno.119 is: No XENIX semaphores available
errno.120 is: Is a named type file
errno.121 is: Remote I/O error
errno.122 is: Disk quota exceeded
errno.123 is: No medium found
errno.124 is: Wrong medium type
errno.125 is: Operation canceled
errno.126 is: Required key not available
errno.127 is: Key has expired
errno.128 is: Key has been revoked
errno.129 is: Key was rejected by service
errno.130 is: Owner died
errno.131 is: State not recoverable
errno.132 is: Unknown error 132
132-255 全是Unknown error
TCP/IP 某些最常见的错误原因码 (errno)列表的更多相关文章
- TCP/IP 最常见的错误原因码 (errno)列表
对于在基于 UNIX 的环境中的 TCP/IP 用户,下表列出了某些最常见的错误原因码 (errno).它不是完整的错误列表.可以在文件 /usr/include/sys/errno.h 中找到 Er ...
- 计算机网络(二),TCP/IP四层模型常见协议
目录 1.应用层协议 2.传输层协议 3.网络层协议 4.链路层协议 二.TCP/IP四层模型常见协议 1.应用层协议 (1)POP3 (2)FTP (3)HTTP (4)Telnet (5)SMTP ...
- 浅谈TCP/IP(new 常见面试问题)
1. TCP/IP重传机制,如何保证消息读到一个完整内容再反序列化 2. TCP四次回收比三次握手多了什么操作,什么时候会进入Time_await状态 3.
- TCP connect EADDRNOTAVAIL(99)错误原因分析
转自:http://blog.chinaunix.net/uid-20662820-id-3371081.html 关于TCP connect 返回错误99,可以能大家都会遇到,这里就分析一下这个错误 ...
- TCP/IP网络编程中socket的行为
一. read/write的语义:为什么会阻塞? 先从write说起: #include <unistd.h>ssize_t write(int fd, const void *buf, ...
- 浅谈TCP/IP网络编程中socket的行为
我认为,想要熟练掌握Linux下的TCP/IP网络编程,至少有三个层面的知识需要熟悉: 1. TCP/IP协议(如连接的建立和终止.重传和确认.滑动窗口和拥塞控制等等) 2. Socket I/O系统 ...
- OSI与TCP/IP模型之比较
摘要:OSI参考模型和Internet模型(或称TCP/IP模型)作为计算网络发展过程影响力大的两大模型,它们共同之处是:都采用了层次结构的概念,从分析两者的异同入手,找出OSI的消亡和Interne ...
- 5G与TCP/IP
众所周知,4G LTE全面IP化,上层传输走的是TCP/IP协议(如下图). ▲LTE用户面协议构架 但是,我们熟悉的这个构架并没有发挥出移动网络的全部潜力,甚至阻碍了未来网络的发展. 1 TCP/ ...
- TCP/IP之蓟辽督师
真正的知识是深入浅出的,码农翻身" 公共号将苦涩难懂的计算机知识,用形象有趣的生活中实例呈现给我们,让我们更好地理解. 本文源地址:TCP/IP之蓟辽督师 本文续<TCP/IP之大明内 ...
随机推荐
- Python学习(15)文件/IO
目录 Python 文件I/O 打印到屏幕 读取键盘输入 打开和关闭文件 File对象属性 文件定位 重命名和删除文件 Python的目录 Python 文件I/O 本章只讲述所有基本的的I/O函数, ...
- 百度编辑器Ueditor的简单调用
先去ueditou.baidu.com网站下载百度编辑器,放到项目根目录下的Data目录中,然后引入文件 <!DOCTYPE html> <html lang="en&qu ...
- maven pom.xml解释 (转)
maven3实战之maven使用入门(编写POM) ---------- maven项目的核心是pom.xml.POM(Project Object Model,项目对象模型)定义了项目的基本信息,用 ...
- Android网络编程系列 一 TCP/IP协议族之网际层
这篇借鉴的文章主要是用于后续文章知识点的扩散,在此特作备份和扩散学习交流. 网际层包括:IP.ICMP.IGMP 以及处在网际层实际工作在链路层的 ARP 和 RARP等等协议. 1.IP协议 互联网 ...
- [css] 浏览器字体和css设置字体之间的关系
原文链接:http://www.zhangxinxu.com/wordpress/2010/06/%E5%8F%AF%E7%94%A8%E6%80%A7%E4%B9%8B%E6%B5%8F%E8%A7 ...
- hibernate的注解属性mappedBy详解
mappedBy: 1>只有OneToOne,OneToMany,ManyToMany上才有mappedBy属性,ManyToOne不存在该属性: 2>mappedBy标签一定是定义在被拥 ...
- 转:21副GIF动图让你了解各种数学概念
21副GIF动图让你了解各种数学概念
- 无法找到脚本*.VBS的脚本引擎解决办法
当你在运行一些基于VBS脚本语言的文件时,系统可能报错.这时候可能是你的VBS脚本服务在注册表中出错了,原因可能是卸载或安装一些代码不规范的程序引起的.这里给出无法找到脚本引擎"vbscri ...
- Java客户端通过Http发送POST请求上传文件到web服务器
http://www.cnblogs.com/WilliamJiang/archive/2012/04/29/2475883.html 1.朋友的一个需求,让我给他实现,需求是这样的,需要用ASP.n ...
- 【转】 C++中的new VS C语言中的malloc
作者:gnuhpc 出处:http://www.cnblogs.com/gnuhpc/ 前几天一个朋友去面试百度空间的一个职位,被问及这个问题,我听后说了几点,不过感觉还是不透彻,所以上网查阅了一些资 ...