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之大明内 ...
随机推荐
- sqlserver 批量删除存储过程(转)
sqlserver一次只能删除一个存储过程,如果多了,需要很长时间才能删完,所以写了一段语句,直接就把当然数据库下所有用户自定义的存储过程给drop了.不过使用都请留心,当前打开的数据库哦.下面贴代码 ...
- Linux用户查询
用户列表文件:/etc/passwd 用户组列表文件:/etc/group 查看系统中有哪些用户:cut -d : -f 1 /etc/passwd 查看可以登录系统的用户:cat /etc/pass ...
- c#动态创建ODBC数据源
使用C#有两种方法可以动态的创建ODBC数据源,这里我用比较常用的SQL2000作为例子. 方法1:直接操作注册表,需要引用Microsoft.Win32命名空间 /// <summary> ...
- Python设计模式之单例模式
1.由于语言的特性不同,设计模式的实现方式和实现难度也会不同 2.有的模式已经在语言内置了,比如迭代器模式. 3.单例模式可以直接用模块级变量来实现 4.普通工厂模式可以直接通过传入"类名& ...
- unicode 和 utf-8 的关系和解释
首先一个字节就是8个晶体管同时发出的信号集, unicode就是一套编码,所有的字符都用2个字节表示,不像gbk和gb2312既保持了以前的ansi/ascii的字符单个字节编码,有发明了两个字节保存 ...
- grub4dos通用菜单及相关工具包
grub4dos通用菜单及相关工具包 全套工具包(含PE.ISO,可根据需要替换删减):http://pan.baidu.com/s/1i4EjWod模板文件3.3M(不含PE.ISO):http:/ ...
- 扩展Date的DateDiff方法--日期差
Date.prototype.DateDiff = function(after){ var diffDay; var beforeDate = new Date(this).format(" ...
- Python中pip版本升级error:You are using pip version 7.1.2, however version 8.1.1 is available.
使用pip install安装命令时,会报错:You are using pip version 7.1.2, however version 8.1.1 is available. 尝试了推荐解决办 ...
- Redis与Java - 数据结构
Redis与Java 标签 : Java与NoSQL Redis(REmote DIctionary Server) is an open source (BSD licensed), in-memo ...
- Eclipse管理Java工程(j2se/j2ee/maven)
Eclipse管理J2SE/J2EE(Maven)项目 eclipse是一个集成开发工具,有编译,运行,打包部署等功能.eclipse可以新建多种项目,不同的项目有不同的IDE层次结构,方便用户管理资 ...