当前位置: 技术问答>linux和unix
socket编程的问题,高分求救!!
来源: 互联网 发布时间:2015-05-13
本文导语: 以下是我的程序: /* prepare an address struct to listen for connections */ bzero((char *) &servaddr, sizeof(servaddr)); servaddr.sin_family= AF_...
以下是我的程序:
/* prepare an address struct to listen for connections */
bzero((char *) &servaddr, sizeof(servaddr));
servaddr.sin_family= AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons( 9001 ); /* get a socket... */
if ((sockfd = socket(AF_INET,SOCK_STREAM,0))
/* prepare an address struct to listen for connections */
bzero((char *) &servaddr, sizeof(servaddr));
servaddr.sin_family= AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons( 9001 ); /* get a socket... */
if ((sockfd = socket(AF_INET,SOCK_STREAM,0))