Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/libraries/network/Connection.cc

    r8858 r11054  
    4646
    4747  Connection::Connection(uint32_t firstPeerID):
    48     host_(0), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID)
     48    host_(nullptr), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID)
    4949  {
    5050    enet_initialize();
     
    8181  {
    8282//     this->overallMutex_->lock();
    83     outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 };
     83    outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, nullptr, 0 };
    8484   
    8585    this->outgoingEventsMutex_->lock();
     
    9191  void Connection::disconnectPeers()
    9292  {
    93     outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, 0, 0 };
     93    outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, nullptr, 0 };
    9494   
    9595    this->outgoingEventsMutex_->lock();
     
    237237  void Connection::disconnectPeersInternal()
    238238  {
    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);
    243242    }
    244243    uint32_t iterations = NETWORK_DISCONNECT_TIMEOUT/NETWORK_WAIT_TIMEOUT;
     
    323322   
    324323    // create new peerEvent and return it
    325     incomingEvent inEvent = { peerID, incomingEventType::peerConnect, 0 };
     324    incomingEvent inEvent = { peerID, incomingEventType::peerConnect, nullptr };
    326325    return inEvent;
    327326  }
     
    338337   
    339338    // create new peerEvent and return it
    340     incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, 0 };
     339    incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, nullptr };
    341340    return inEvent;
    342341  }
Note: See TracChangeset for help on using the changeset viewer.