- Timestamp:
- Nov 18, 2005, 2:33:26 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_socket.cc
r5630 r5631 172 172 173 173 //printf("length=%d, bufsize=%d\n", length, _OUTGOING_BUFFER_SIZE); 174 if (length>_OUTGOING_BUFFER_SIZE)175 {176 int res = 0;177 int n = length / _OUTGOING_BUFFER_SIZE;178 if (length % _OUTGOING_BUFFER_SIZE != 0)179 n++;180 // printf("n=%d\n", n);181 SDL_Delay(500);182 for (int i = 0; i<n; i++)183 {184 // printf("i=%d\n", i);185 if (i==n-1)186 {187 res += writeBytes(data + i*_OUTGOING_BUFFER_SIZE, length-i*_OUTGOING_BUFFER_SIZE);188 // printf("res = %d\n", res);189 }190 else191 {192 res += writeBytes(data + i*_OUTGOING_BUFFER_SIZE, _OUTGOING_BUFFER_SIZE);193 // printf("res = %d\n", res);194 }195 }196 return res;197 }174 // if (length>_OUTGOING_BUFFER_SIZE) 175 // { 176 // int res = 0; 177 // int n = length / _OUTGOING_BUFFER_SIZE; 178 // if (length % _OUTGOING_BUFFER_SIZE != 0) 179 // n++; 180 // // printf("n=%d\n", n); 181 // SDL_Delay(500); 182 // for (int i = 0; i<n; i++) 183 // { 184 // // printf("i=%d\n", i); 185 // if (i==n-1) 186 // { 187 // res += writeBytes(data + i*_OUTGOING_BUFFER_SIZE, length-i*_OUTGOING_BUFFER_SIZE); 188 // // printf("res = %d\n", res); 189 // } 190 // else 191 // { 192 // res += writeBytes(data + i*_OUTGOING_BUFFER_SIZE, _OUTGOING_BUFFER_SIZE); 193 // // printf("res = %d\n", res); 194 // } 195 // } 196 // return res; 197 // } 198 198 199 199 #define min(a,b) (a<b)?a:b -
branches/network/src/lib/network/network_socket.h
r5630 r5631 12 12 13 13 #define _INCOMING_BUFFER_SIZE 10240 14 #define _OUTGOING_BUFFER_SIZE 30240014 #define _OUTGOING_BUFFER_SIZE 2024000 15 15 #define _LOCAL_BUFFER_SIZE 1024 16 16 //sleep if incoming buffer is full
Note: See TracChangeset
for help on using the changeset viewer.