1、创建套接字 #include <sys/socket.h> int socket(int domain,int type,int protocol); domain:套接字中使用的协议族(protocol family)信息 type:套接字数据传输类型信息 protocol:计算机间通信中使用的协议信息 2、协议族