当前位置: 技术问答>linux和unix
socket中经典例子talk,编译错误,请教原因
来源: 互联网 发布时间:2015-09-20
本文导语: 程序:摘自LINUX网络编程 #include #include #include #include #include #include #include #define BUFLEN 255 int main(int argc, char **argv) { ...
程序:摘自LINUX网络编程
#include
#include
#include
#include
#include
#include
#include
#define BUFLEN 255
int
main(int argc, char **argv)
{
struct sockaddr_in peeraddr, localaddr;
int sockfd, stdinfd, n, maxfd, socklen, flags;
char msg[BUFLEN + 1];
fd_set infds;
if (argc != 5) {
printf("%s
n", argv[0]);
exit(0);
}
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd
#include
#include
#include
#include
#include
#include
#include
#define BUFLEN 255
int
main(int argc, char **argv)
{
struct sockaddr_in peeraddr, localaddr;
int sockfd, stdinfd, n, maxfd, socklen, flags;
char msg[BUFLEN + 1];
fd_set infds;
if (argc != 5) {
printf("%s
n", argv[0]);
exit(0);
}
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (sockfd