|
|
接上篇“创建socket”一文;
<div style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; text-indent: 0px; margin-left: 0px; font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline;">
5、分配sock结构:
本文中的例子会调用inet_family_ops.create方法即inet_create方法完成socket的创建工作;其调用链如下:
net/Socket.c:sys_socket()->sock_create()->__sock_create()->net/ipv4/Af_inet.c:inet_create();
inet_create()主要完成以下几个工作:
1) 设置socket的状态为SS_UNCONNECTED;
sock->state = SS_UNCONNECTED;
<div style="text-align: justify;">
|
|