Changeset 6018 in orxonox.OLD for branches/network/src/subprojects
- Timestamp:
- Dec 10, 2005, 6:48:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/subprojects/network/network_unit_test.cc
r5996 r6018 42 42 NetworkSocket client1(ip); 43 43 44 NetworkSocket server1 = server.getNewSocket();44 NetworkSocket* server1 = server.getNewSocket(); 45 45 46 46 NetworkSocket client2(ip); 47 47 48 NetworkSocket server2 = server.getNewSocket();48 NetworkSocket* server2 = server.getNewSocket(); 49 49 50 50 char buf[1024]; … … 63 63 n = client1.writePacket((byte*)str1, strlen(str1)+1); 64 64 printf("%d bytes send from client1\n", n); 65 n = server1 .writePacket((byte*)str2, strlen(str2)+1);65 n = server1->writePacket((byte*)str2, strlen(str2)+1); 66 66 printf("%d bytes send from server1\n", n); 67 67 n = client2.writePacket((byte*)str3, strlen(str3)+1); 68 68 printf("%d bytes send from client2\n", n); 69 n = server2 .writePacket((byte*)str4, strlen(str4)+1);69 n = server2->writePacket((byte*)str4, strlen(str4)+1); 70 70 printf("%d bytes send from server2\n", n); 71 71 SDL_Delay(1000); 72 72 73 73 printf("read from server1\n"); 74 n = server1 .readPacket((byte*)buf, 1024);74 n = server1->readPacket((byte*)buf, 1024); 75 75 printf("read %d bytes\n", n); 76 76 if (n<0) … … 80 80 81 81 printf("read from server2\n"); 82 n = server2 .readPacket((byte*)buf, 1024);82 n = server2->readPacket((byte*)buf, 1024); 83 83 printf("read %d bytes\n", n); 84 84 if (n<0) … … 108 108 printf("result: %d\n", client1.writePacket((byte*)buf, 1000)); 109 109 110 server1 .writePacket((byte*)str1, strlen(str1)+1);110 server1->writePacket((byte*)str1, strlen(str1)+1); 111 111 SDL_Delay(500); 112 112 printf("try to read with a too small buffer\n");
Note: See TracChangeset
for help on using the changeset viewer.