发布时间:2016-01-11 15:17:31
服务端:int main(){//创建socketint sockfd=socket(PF_LOCAL, SOCK_DGRAM, 0);if(sockfd==-1)perror("创建socket失败"),exit(-1);//准备通信地址struct sockaddr_un addr;addr.sun_family = PF_UNIX;strcpy(addr.sun_path,"a.sock"); //绑定int res = bind(sockfd, (struct sockaddr*)&addr, .........【阅读全文】