Changeset 5628 in orxonox.OLD for branches/network/src/subprojects
- Timestamp:
- Nov 18, 2005, 10:55:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/subprojects/network/network_unit_test.cc
r5627 r5628 61 61 printf("data: %s\n", buf); 62 62 63 printf("testing a bigger amount of data\n"); 64 65 #define _N_ELEMENTS 212992 66 char sendbuf[_N_ELEMENTS]; 67 char recvbuf[_N_ELEMENTS]; 68 69 for (int i = 0; i<_N_ELEMENTS; i++) 70 sendbuf[i] = i%30 + 30; 71 72 printf("write\n"); 73 client.writeBytes((byte*)sendbuf, _N_ELEMENTS); 74 75 SDL_Delay(500); 76 77 printf("read\n"); 78 int nbytes = server.readBytes((byte*)recvbuf, _N_ELEMENTS); 79 int offset = nbytes; 80 81 while (nbytes>0) 82 { 83 SDL_Delay(10); 84 printf("read\n"); 85 nbytes = server.readBytes((byte*)recvbuf+offset, _N_ELEMENTS-offset); 86 offset += nbytes; 87 printf("nbytes=%d, offset=%d\n", nbytes, offset); 88 } 89 90 printf("strcmp = %d (0 is good :D not 0 is evil)\noffset = %d\n", strncmp(sendbuf, recvbuf, _N_ELEMENTS), offset); 91 63 92 return 0; 64 93 }
Note: See TracChangeset
for help on using the changeset viewer.