当前位置: 技术问答>linux和unix
请教Socket select 无法延时 阻塞 问题
来源: 互联网 发布时间:2016-03-02
本文导语: /* tcpport_select.c */ #include #include #include #include #include #include #include #include #include #include #include #define STARTPORT 80 #define ENDPORT 83 #define h_addr h_addr_list[0] int main(int argc,char *argv[]) { int sockfd,i; ...
/* tcpport_select.c */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define STARTPORT 80
#define ENDPORT 83
#define h_addr h_addr_list[0]
int main(int argc,char *argv[])
{
int sockfd,i;
struct hostent *host;
struct sockaddr_in host_addr;
int flag,flag1;
struct timeval tv={5,0};
socklen_t len=sizeof(int);
fd_set wfds;
int error;
if (argc h_addr);
bzero(&(host_addr.sin_zero),8);
for(i=1;i
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define STARTPORT 80
#define ENDPORT 83
#define h_addr h_addr_list[0]
int main(int argc,char *argv[])
{
int sockfd,i;
struct hostent *host;
struct sockaddr_in host_addr;
int flag,flag1;
struct timeval tv={5,0};
socklen_t len=sizeof(int);
fd_set wfds;
int error;
if (argc h_addr);
bzero(&(host_addr.sin_zero),8);
for(i=1;i