- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/libraries/network/Connection.cc
r8858 r11054 46 46 47 47 Connection::Connection(uint32_t firstPeerID): 48 host_( 0), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID)48 host_(nullptr), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID) 49 49 { 50 50 enet_initialize(); … … 81 81 { 82 82 // this->overallMutex_->lock(); 83 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 };83 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, nullptr, 0 }; 84 84 85 85 this->outgoingEventsMutex_->lock(); … … 91 91 void Connection::disconnectPeers() 92 92 { 93 outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, 0, 0 };93 outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, nullptr, 0 }; 94 94 95 95 this->outgoingEventsMutex_->lock(); … … 237 237 void Connection::disconnectPeersInternal() 238 238 { 239 std::map<uint32_t, ENetPeer*>::iterator it; 240 for( it=this->peerMap_.begin(); it!=this->peerMap_.end(); ++it ) 241 { 242 enet_peer_disconnect(it->second, 0); 239 for( const auto& mapEntry : this->peerMap_ ) 240 { 241 enet_peer_disconnect(mapEntry.second, 0); 243 242 } 244 243 uint32_t iterations = NETWORK_DISCONNECT_TIMEOUT/NETWORK_WAIT_TIMEOUT; … … 323 322 324 323 // create new peerEvent and return it 325 incomingEvent inEvent = { peerID, incomingEventType::peerConnect, 0};324 incomingEvent inEvent = { peerID, incomingEventType::peerConnect, nullptr }; 326 325 return inEvent; 327 326 } … … 338 337 339 338 // create new peerEvent and return it 340 incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, 0};339 incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, nullptr }; 341 340 return inEvent; 342 341 }
Note: See TracChangeset
for help on using the changeset viewer.