- Timestamp:
- Nov 20, 2007, 9:36:41 PM (17 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/ClientConnection.cc
r217 r229 50 50 } 51 51 52 voidClientConnection::createConnection(){52 bool ClientConnection::createConnection(){ 53 53 network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this)); 54 // boost::thread thr(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this)); 55 return ;54 // wait 10 seconds for the connection to be established 55 return waitEstablished(10000); 56 56 } 57 57 … … 77 77 return false; 78 78 if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0) 79 return true; 80 else 81 return false; 82 } 83 84 bool ClientConnection::sendPackets(){ 85 ENetEvent event; 86 if(server==NULL) 87 return false; 88 if(enet_host_service(client, &event, NETWORK_SEND_WAIT)>=0) 79 89 return true; 80 90 else -
code/branches/network/src/network/ClientConnection.h
r217 r229 41 41 bool queueEmpty(); 42 42 // create a new listener thread 43 voidcreateConnection();43 bool createConnection(); 44 44 bool closeConnection(); 45 45 // add a packet to queue for the server 46 46 bool addPacket(ENetPacket *packet); 47 47 // send out all queued packets 48 bool sendPackets(); 49 // send out all queued packets and save result in event 48 50 bool sendPackets(ENetEvent *event); 49 51 bool waitEstablished(int milisec); -
code/branches/network/src/network/ConnectionManager.cc
r204 r229 73 73 74 74 bool ConnectionManager::addPacket(ENetPacket *packet, int ID){ 75 if(client= NULL)75 if(client==NULL) 76 76 return false; 77 77 ClientList *temp=client; -
code/branches/network/src/network/Makefile
r217 r229 23 23 PacketDecoder.o: PacketDecoder.cc 24 24 ${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC} 25 25 Client.o: Client.cc 26 ${CC} -c Client.cc -g ${INC} 26 27 27 28 clean:
Note: See TracChangeset
for help on using the changeset viewer.