Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 217


Ignore:
Timestamp:
Nov 16, 2007, 11:31:17 PM (17 years ago)
Author:
scheusso
Message:

-implemented class ClientConnection:

  • implements the network part of a client (analog to ConnectionManager for the server)
  • again there is a receiver-Thread and a buffer
  • (hopefully) clean disconnection and wait for connection

-extended dummyclient (dummyclient2.cc) to use new ClientConnection class
-make target client builds now dummyclient2
-adjusted the Makefile

Location:
code/branches/network/src/network
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Makefile

    r210 r217  
    1414ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
    1515        ${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
     16ClientConnection.o: ClientConnection.cc ClientConnection.h
     17        ${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
    1618
    1719PacketBuffer.o: PacketBuffer.cc
     
    2628        rm -rf *.o
    2729
    28 client: PacketGenerator.o dummyclient.cc
     30client_old: PacketGenerator.o dummyclient.cc
    2931        ${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
     32client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc
     33        ${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
  • code/branches/network/src/network/dummyclient.cc

    r213 r217  
    5252    cout << "Connection to " << str << " failed." << endl;
    5353    //puts("Connection to localhost:5555 failed.");
     54    exit(EXIT_FAILURE);
    5455  }
    5556
     
    5960        // extend the packet and append the string foo to it
    6061        // send packet to peer on channel id 0
    61     enet_peer_send(peer, 1, pck.chatMessage("test"));
     62    enet_peer_send(peer, 1, pck.chatMessage("test2"));
    6263        // keep the timeout very small for low delay
    6364    if(enet_host_service(client, &event, 1)==0){
     
    6667      cout << "failed sending" << endl;
    6768    }
     69    usleep(1000000);
    6870  }
    6971
Note: See TracChangeset for help on using the changeset viewer.