Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7898


Ignore:
Timestamp:
Feb 15, 2011, 11:37:15 AM (13 years ago)
Author:
scheusso
Message:

trying to fix some uninitialised value warnings from valgrind
remove overall mutex

Location:
code/branches/network6/src/libraries/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network6/src/libraries/network/Connection.cc

    r7881 r7898  
    4242namespace orxonox
    4343{
    44   const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(20);
     44  const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(200);
    4545  const unsigned int                NETWORK_DISCONNECT_TIMEOUT = 500;
    4646
     
    5252    this->incomingEventsMutex_ = new boost::mutex;
    5353    this->outgoingEventsMutex_ = new boost::mutex;
    54     this->overallMutex_ = new boost::mutex;
     54//     this->overallMutex_ = new boost::mutex;
    5555  }
    5656
     
    8080  void Connection::disconnectPeer(uint32_t peerID)
    8181  {
    82     this->overallMutex_->lock();
     82//     this->overallMutex_->lock();
    8383    outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 };
    8484   
     
    8686    this->outgoingEvents_.push_back(outEvent);
    8787    this->outgoingEventsMutex_->unlock();
    88     this->overallMutex_->unlock();
     88//     this->overallMutex_->unlock();
    8989  }
    9090 
     
    100100  void Connection::addPacket(ENetPacket* packet, uint32_t peerID, uint8_t channelID)
    101101  {
    102     this->overallMutex_->lock();
     102//     this->overallMutex_->lock();
    103103    outgoingEvent outEvent = { peerID, outgoingEventType::sendPacket, packet, channelID };
    104104   
     
    106106    this->outgoingEvents_.push_back(outEvent);
    107107    this->outgoingEventsMutex_->unlock();
    108     this->overallMutex_->unlock();
     108//     this->overallMutex_->unlock();
    109109  }
    110110 
    111111  void Connection::broadcastPacket(ENetPacket* packet, uint8_t channelID)
    112112  {
    113     this->overallMutex_->lock();
     113//     this->overallMutex_->lock();
    114114    outgoingEvent outEvent = { 0, outgoingEventType::broadcastPacket, packet, channelID };
    115115   
     
    117117    this->outgoingEvents_.push_back(outEvent);
    118118    this->outgoingEventsMutex_->unlock();
    119     this->overallMutex_->unlock();
     119//     this->overallMutex_->unlock();
    120120  }
    121121
     
    125125    ENetEvent event;
    126126   
    127     this->overallMutex_->lock();
     127//     this->overallMutex_->lock();
    128128    while( bCommunicationThreadRunning_ )
    129129    {
     
    134134      }
    135135     
    136       this->overallMutex_->unlock();
     136//       this->overallMutex_->unlock();
    137137      msleep(10);
    138       this->overallMutex_->lock();
     138//       this->overallMutex_->lock();
    139139     
    140140      // Send all waiting outgoing packets
     
    163163      }
    164164    }
    165     this->overallMutex_->unlock();
     165//     this->overallMutex_->unlock();
    166166  }
    167167 
  • code/branches/network6/src/libraries/network/ServerConnection.cc

    r7878 r7898  
    4545  {
    4646    this->bindAddress_ = new ENetAddress();
    47     memset(this->bindAddress_, 0, sizeof(ENetAddress));
     47//     memset(this->bindAddress_, 0, sizeof(ENetAddress));
    4848    this->bindAddress_->host = ENET_HOST_ANY;
    4949    this->bindAddress_->port = NETWORK_PORT;
     50    this->bindAddress_->scopeID = 0;
    5051  }
    5152
  • code/branches/network6/src/libraries/network/packet/Gamestate.cc

    r7825 r7898  
    158158  //start write gamestate header
    159159  header_.setDataSize( currentsize );
     160  header_.setCompSize( 0 );
    160161  header_.setID( id );
    161162  header_.setBaseID( GAMESTATEID_INITIAL );
Note: See TracChangeset for help on using the changeset viewer.