<div class="dp-highlighter bg_cpp">
<div class="bar">
<div class="tools">
[cpp]?<a class="ViewSource" title="view plain" href="http://blog.csdn.net/geekcome/article/details/7488828">view plain<a class="CopyToClipboard" title="copy" href="http://blog.csdn.net/geekcome/article/details/7488828">copy
?
- ?????family;??
-
- ?????(*create)???(?socket?*sock,??protocol);??
-
- ?????(*release)??(?socket?*sock,??socket?*peer);??
-
- ??????????????sockaddr_len);??
-
- ??????????????sockaddr_len,??flags);??
-
- ?????(*accept)???(?socket?*sock,??socket?*newsock,??
-
- ?????(*getname)??(?socket?*sock,??sockaddr?*uaddr,??
-
- ?????(*read)?????(?socket?*sock,??*ubuf,??size,??
-
- ?????(*write)????(?socket?*sock,??
-
- ?????(*select)???(?socket?*sock,??sel_type,??
-
- ?????(*ioctl)????(?socket?*sock,?unsigned??cmd,??
-
- ?????(*listen)???(?socket?*sock,??len);??
-
- ?????????????unsigned?flags);??
-
- ?????????????unsigned?flags);??
-
- ?????????????unsigned?flags,??sockaddr?*,??addr_len);??
-
-
- ?????(*setsockopt)???(?socket?*sock,??level,??optname,??
-
- ?????(*getsockopt)???(?socket?*sock,??*optlen);??
- ?????(*fcntl)????(?socket?*sock,??
-
- };??
可以看到,这里实际上就是一系列操作的函数,有点类似于文件系统中的file_operations。通过参数传递socket完成操作。
接下来是proto_init()协议初始化。
(编辑:应用网_丽江站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|