socket在Linux中对应的文件系统叫Sockfs,每创建一个socket,就在sockfs中创建了一个特殊的文件,同时创建了sockfs文件系统中的inode,该inode唯一标识当前socket的通信。 如下图所示,左侧窗口使用nc工具创建一个TCP连接;右侧找到该进程id(3384),通过查看该进程下的描述符 ...
笔者一直觉得如果能知道从应用到框架再到操作系统的每一处代码,是一件Exciting的事情。今天笔者就来从Linux源码的角度看下Server端的Socket在进行bind的时候到底做了哪些事情(基于Linux 3.10内核)。 一个最简单的Server端例子 众所周知,一个Server端Socket的建立,需要 ...
创建套接字,将其设置成非阻塞状态。 调用connect连接对端主机,如果失败,判断当时的errno是否为EINPROGRESS,也就是说是不是连接正在进行中,如果是,转到步骤3,如果不是,返回错误。 用select在指定的超时时间内监听套接字的写就绪事件,如果select有监听到 ...
Quad-core computing can cut server hardware costs and software licensing in half At Linux World 2006 in San Francisco, AMD flexed its muscle in the four and eight socket server market in the IBM and ...
Network geeks among you may remember my article, “Linux Socket Filter: Sniffing Bytes over the Network”, in the June 2001 issue of LJ, regarding the use of the packet filter built inside the Linux ...
I've found myself having do some socket programming in the linux kernel. (yes, yes, I know: have I thought about user space? Yes, that's where I've prototyped my code. This is a research project that ...
In the last issue we started following a packet's journey from the wire up to the higher levels of network stack processing. We left the packet at the end of layer 3 processing, where IP has ...