Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2008, 1:09:12 PM (16 years ago)
Author:
scheusso
Message:

removed some deadlocks and big timeouts in connectionmanager and clientconnection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/ClientConnection.cc

    r1491 r1492  
    133133  }
    134134
    135 //   bool ClientConnection::sendPackets(ENetEvent *event) {
    136 //     if(server==NULL)
    137 //       return false;
    138 //     if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0){
    139 //       return true;}
    140 //     else
    141 //       return false;
    142 //   }
    143 
    144135  bool ClientConnection::sendPackets() {
    145     ENetEvent event;
    146136    if(server==NULL)
    147137      return false;
    148138    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
    149139    enet_host_flush(client);
     140    lock.unlock();
    150141    return true;
    151142  }
     
    159150      enet_initialize();
    160151      client = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
     152      lock.unlock();
    161153    }
    162154    if(client==NULL) {
     
    183175          // add some error handling here ========================
    184176        }
     177        lock.unlock();
    185178      }
    186179      switch(event->type){
     
    201194        continue;
    202195      }
    203       //receiverThread_->yield();
     196      receiverThread_->yield();
    204197    }
    205198    // now disconnect
Note: See TracChangeset for help on using the changeset viewer.