Changeset 446
- Timestamp:
- Dec 9, 2007, 8:44:04 PM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientInformation.cc
r444 r446 143 143 bool ClientInformation::removeClient(ENetPeer *peer){ 144 144 ClientInformation *temp = this; 145 while(temp!=0 && (temp->getPeer()->address.host!=peer->address.host || temp->getPeer()->address.port!=peer->address.port)) 145 while(temp!=0){ 146 if(!temp->head) 147 if(temp->getPeer()->address.host==peer->address.host && temp->getPeer()->address.port==peer->address.port) 148 break; 146 149 temp = temp->next(); 150 } 147 151 if(temp==0) 148 152 return false; … … 159 163 ClientInformation *ClientInformation::findClient(int clientID, bool look_backwards){ 160 164 ClientInformation *temp = this; 161 while(temp!=0 && temp->getID()!=clientID) 165 while(temp!=0 && temp->getID()!=clientID){ 166 if (temp->head) 167 continue; 162 168 temp = temp->next(); 169 } 163 170 // returns 0 if nothing has been found 164 171 return temp; -
code/branches/FICN/src/network/ConnectionManager.cc
r444 r446 55 55 ENetPacket *ConnectionManager::getPacket(int &clientID){ 56 56 ENetAddress address; 57 ENetPacket *packet=getPacket(address); std::cout << "searching clientid " << head_->getID() << std::endl;57 ENetPacket *packet=getPacket(address); 58 58 ClientInformation *temp =head_->findClient(&address); 59 std::cout << "searching clientid " << temp << std::endl;60 59 clientID=temp->getID(); 61 60 return packet; … … 141 140 break; 142 141 case ENET_EVENT_TYPE_RECEIVE: 142 std::cout << "received data" << std::endl; 143 143 processData(&event); 144 144 break; -
code/branches/FICN/src/network/dummyclient2.cc
r442 r446 49 49 // usleep(1000000); 50 50 } 51 51 usleep(1000000); 52 52 // now disconnect 53 53 if(client.closeConnection()) -
code/branches/FICN/src/network/dummyclient3.cc
r441 r446 26 26 std::getline( std::cin, str ); 27 27 client.sendChat( str ); 28 std::cout << "send message" << std::endl; 28 29 } 29 30 } -
code/branches/FICN/src/network/dummyserver3.cc
r444 r446 37 37 38 38 void dummyserver3::tick(){ 39 Server::processQueue();39 processQueue(); 40 40 } 41 41
Note: See TracChangeset
for help on using the changeset viewer.