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/ConnectionManager.cc

    r1491 r1492  
    169169  }
    170170
    171   /*bool ConnectionManager::sendPackets(ENetEvent *event) {
    172     if(server==NULL)
    173       return false;
    174     if(enet_host_service(server, event, NETWORK_SEND_WAIT)>=0)
    175       return true;
    176     else
    177       return false;
    178   }*/
    179 
    180171  bool ConnectionManager::sendPackets() {
    181172    if(server==NULL)
     
    183174    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
    184175    enet_host_flush(server);
     176    lock.unlock();
    185177    return true;
    186178  }
     
    194186      enet_initialize();
    195187      server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
     188      lock.unlock();
    196189    }
    197190    if(server==NULL){
     
    211204          // add some error handling here ========================
    212205        }
     206        lock.unlock();
    213207      }
    214208      switch(event->type){
     
    235229        case ENET_EVENT_TYPE_NONE:
    236230          delete event;
    237           //receiverThread_->yield();
     231          receiverThread_->yield();
    238232          break;
    239233      }
     
    246240      boost::recursive_mutex::scoped_lock lock(enet_mutex_);
    247241      enet_host_destroy(server);
     242      lock.unlock();
    248243    }
    249244  }
     
    259254        boost::recursive_mutex::scoped_lock lock(enet_mutex_);
    260255        enet_peer_disconnect(temp->getPeer(), 0);
     256        lock.unlock();
    261257      }
    262258      temp = temp->next();
     
    439435      boost::recursive_mutex::scoped_lock lock(enet_mutex_);
    440436      enet_peer_disconnect(client->getPeer(), 0);
     437      lock.unlock();
    441438    }
    442439    removeShip(client);
Note: See TracChangeset for help on using the changeset viewer.