Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6018 in orxonox.OLD for branches/network/src/subprojects


Ignore:
Timestamp:
Dec 10, 2005, 6:48:01 PM (19 years ago)
Author:
rennerc
Message:

NetworkStream should now accept net connections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/subprojects/network/network_unit_test.cc

    r5996 r6018  
    4242  NetworkSocket client1(ip);
    4343
    44   NetworkSocket server1 = server.getNewSocket();
     44  NetworkSocket* server1 = server.getNewSocket();
    4545
    4646  NetworkSocket client2(ip);
    4747
    48   NetworkSocket server2 = server.getNewSocket();
     48  NetworkSocket* server2 = server.getNewSocket();
    4949
    5050  char buf[1024];
     
    6363  n = client1.writePacket((byte*)str1, strlen(str1)+1);
    6464  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);
    6666  printf("%d bytes send from server1\n", n);
    6767  n = client2.writePacket((byte*)str3, strlen(str3)+1);
    6868  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);
    7070  printf("%d bytes send from server2\n", n);
    7171  SDL_Delay(1000);
    7272
    7373  printf("read from server1\n");
    74   n = server1.readPacket((byte*)buf, 1024);
     74  n = server1->readPacket((byte*)buf, 1024);
    7575  printf("read %d bytes\n", n);
    7676  if (n<0)
     
    8080
    8181  printf("read from server2\n");
    82   n = server2.readPacket((byte*)buf, 1024);
     82  n = server2->readPacket((byte*)buf, 1024);
    8383  printf("read %d bytes\n", n);
    8484  if (n<0)
     
    108108  printf("result: %d\n", client1.writePacket((byte*)buf, 1000));
    109109
    110   server1.writePacket((byte*)str1, strlen(str1)+1);
     110  server1->writePacket((byte*)str1, strlen(str1)+1);
    111111  SDL_Delay(500);
    112112  printf("try to read with a too small buffer\n");
Note: See TracChangeset for help on using the changeset viewer.