Changeset 1492 for code/branches/network/src/network/ConnectionManager.cc
- Timestamp:
- May 31, 2008, 1:09:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/ConnectionManager.cc
r1491 r1492 169 169 } 170 170 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 else177 return false;178 }*/179 180 171 bool ConnectionManager::sendPackets() { 181 172 if(server==NULL) … … 183 174 boost::recursive_mutex::scoped_lock lock(enet_mutex_); 184 175 enet_host_flush(server); 176 lock.unlock(); 185 177 return true; 186 178 } … … 194 186 enet_initialize(); 195 187 server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0); 188 lock.unlock(); 196 189 } 197 190 if(server==NULL){ … … 211 204 // add some error handling here ======================== 212 205 } 206 lock.unlock(); 213 207 } 214 208 switch(event->type){ … … 235 229 case ENET_EVENT_TYPE_NONE: 236 230 delete event; 237 //receiverThread_->yield();231 receiverThread_->yield(); 238 232 break; 239 233 } … … 246 240 boost::recursive_mutex::scoped_lock lock(enet_mutex_); 247 241 enet_host_destroy(server); 242 lock.unlock(); 248 243 } 249 244 } … … 259 254 boost::recursive_mutex::scoped_lock lock(enet_mutex_); 260 255 enet_peer_disconnect(temp->getPeer(), 0); 256 lock.unlock(); 261 257 } 262 258 temp = temp->next(); … … 439 435 boost::recursive_mutex::scoped_lock lock(enet_mutex_); 440 436 enet_peer_disconnect(client->getPeer(), 0); 437 lock.unlock(); 441 438 } 442 439 removeShip(client);
Note: See TracChangeset
for help on using the changeset viewer.