Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2009, 12:27:19 AM (15 years ago)
Author:
scheusso
Message:

rest of the cleanup ( mostly client connection handling)
network is now single-threaded ( only in order to become multithreaded again, but thats another story ;) )

File:
1 edited

Legend:

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

    r3201 r3202  
    3131#include <iostream>
    3232#include <cassert>
     33#include <OgreTimer.h>
    3334
    3435#include "util/Debug.h"
     
    4849    assert(instance_==0);
    4950    Connection::instance_=this;
     51    enet_initialize();
     52    atexit(enet_deinitialize);
    5053  }
    5154
     
    7275   
    7376    assert(this->host_);
     77    Ogre::Timer timer;
    7478
    75     if( enet_host_service( this->host_, &event, NETWORK_WAIT_TIMEOUT ) > 0 )
     79    while( timer.getMilliseconds()<NETWORK_MAX_QUEUE_PROCESS_TIME && enet_host_service( this->host_, &event, NETWORK_WAIT_TIMEOUT ) > 0 )
    7680    {
    7781      switch(event.type){
     
    8185          break;
    8286        case ENET_EVENT_TYPE_DISCONNECT:
    83           disconnectClient( &event );
     87          disconnectPeer( &event );
    8488          break;
    8589        case ENET_EVENT_TYPE_RECEIVE:
Note: See TracChangeset for help on using the changeset viewer.