Changeset 10 in Main for trunk/Server
- Timestamp:
- Sep 13, 2024, 9:06:13 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/server.c
r9 r10 48 48 WSAStartup(MAKEWORD(2, 0), &wsa); 49 49 #endif 50 FD_ZERO(&fdset);51 50 for(i = 0; config.ports[i] != -1; i++) 52 51 ; … … 106 105 return 1; 107 106 } 108 FD_SET(sock, &fdset);109 107 sockets[i] = sock; 110 108 } … … 115 113 struct timeval tv; 116 114 while(1){ 115 FD_ZERO(&fdset); 116 int i; 117 for(i = 0; i < sockcount; i++){ 118 FD_SET(sockets[i], &fdset); 119 } 117 120 tv.tv_sec = 1; 118 121 tv.tv_usec = 0; 119 int ret = select( sockcount, &fdset, NULL, NULL, &tv);122 int ret = select(FD_SETSIZE, &fdset, NULL, NULL, &tv); 120 123 if(ret == -1){ 121 124 break; 122 125 }else if(ret > 0){ 123 126 /* connection */ 124 printf("!\n");125 127 int i; 126 128 for(i = 0; i < sockcount; i++){
Note:
See TracChangeset
for help on using the changeset viewer.