日期:2014-05-16 浏览次数:20681 次
struct sockaddr_in linuxaddr; linuxaddr.sin_addr.s_addr = htonl(INADDR_ANY); linuxaddr.sin_family = AF_INET; linuxaddr.sin_port = htons(12345); if (bind(fd, (struct sockaddr*)&linuxaddr, sizeof(linuxaddr)) < 0) {}