Changeset 2758 for code/branches/network/src/network/ConnectionManager.cc
- Timestamp:
- Mar 8, 2009, 4:40:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/ConnectionManager.cc
r2749 r2758 46 46 #include <boost/bind.hpp> 47 47 48 // #include "core/CoreIncludes.h"49 // #include "core/BaseObject.h"50 // #include "core/Iterator.h"51 48 #include "util/Math.h" 52 49 #include "util/Sleep.h" … … 124 121 void ConnectionManager::createListener() { 125 122 receiverThread_ = new boost::thread(boost::bind(&ConnectionManager::receiverThread, this)); 126 //network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));127 //boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));128 123 return; 129 124 } … … 131 126 bool ConnectionManager::quitListener() { 132 127 quit=true; 133 //network_threads.join_all();134 128 receiverThread_->join(); 135 129 return true; … … 206 200 // log handling ================ 207 201 case ENET_EVENT_TYPE_CONNECT: 208 //COUT(3) << "adding event_type_connect to queue" << std::endl;209 202 case ENET_EVENT_TYPE_DISCONNECT: 210 //addClient(event);211 //this is a workaround to ensure thread safety212 //COUT(5) << "Con.Man: connection event has occured" << std::endl;213 //break;214 203 case ENET_EVENT_TYPE_RECEIVE: 215 //std::cout << "received data" << std::endl;216 //COUT(5) << "Con.Man: receive event has occured" << std::endl;217 // only add, if client has connected yet and not been disconnected218 //if(head_->findClient(&event->peer->address))219 204 processData(event); 220 205 event = new ENetEvent; 221 // else222 // COUT(3) << "received a packet from a client we don't know" << std::endl;223 206 break; 224 //case ENET_EVENT_TYPE_DISCONNECT:225 //clientDisconnect(event->peer);226 //break;227 207 case ENET_EVENT_TYPE_NONE: 228 208 //receiverThread_->yield(); … … 299 279 } 300 280 301 /**302 *303 * @param clientID304 */305 // void ConnectionManager::syncClassid(unsigned int clientID) {306 // unsigned int network_id=0, failures=0;307 // std::string classname;308 // Identifier *id;309 // std::map<std::string, Identifier*>::const_iterator it = Factory::getFactoryMapBegin();310 // while(it != Factory::getFactoryMapEnd()){311 // id = (*it).second;312 // if(id == NULL)313 // continue;314 // classname = id->getName();315 // network_id = id->getNetworkID();316 // if(network_id==0)317 // COUT(3) << "we got a null class id: " << id->getName() << std::endl;318 // COUT(4) << "Con.Man:syncClassid:\tnetwork_id: " << network_id << ", classname: " << classname << std::endl;319 //320 // packet::ClassID *classid = new packet::ClassID( network_id, classname );321 // classid->setClientID(clientID);322 // while(!classid->send() && failures < 10){323 // failures++;324 // }325 // ++it;326 // }327 // //sendPackets();328 // COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;329 // }330 281 331 282 void ConnectionManager::syncClassid(unsigned int clientID) {
Note: See TracChangeset
for help on using the changeset viewer.