linux由于开源就比win好多了 很简单和3环一样 直接看内核源码 (深入了解用户层到内核层 查看linux 源码 tcpip实现 第20章) 分别在:sk->proto与ops //net.h
struct socket {
socket_state state;
unsigned long flags;
const struct proto_ops *ops;
struct fasync_struct *fasync_list;
struct file *file;
struct sock *sk;
wait_queue_head_t wait;
short type;
};
//sock.h
struct sock {
.....
struct {
struct sk_buff *head;
struct sk_buff *tail;
} sk_backlog;
struct sk_buff_head sk_error_queue;
struct proto *sk_prot_creator;
......
}
源码: https://github.com/haidragon/linuxksocket 效果:
https://blog.csdn.net/u010039418/article/details/80628490