Index: /code/branches/netp2/src/network/Client.cc
===================================================================
--- /code/branches/netp2/src/network/Client.cc	(revision 2964)
+++ /code/branches/netp2/src/network/Client.cc	(revision 2965)
@@ -140,32 +140,38 @@
    */
   void Client::tick(float time){
-//     COUT(3) << ".";
-    if(client_connection.isConnected() && isSynched_){
-      COUT(4) << "popping partial gamestate: " << std::endl;
-      packet::Gamestate *gs = gamestate.getGamestate();
-      if(gs){
-        COUT(4) << "client tick: sending gs " << gs << std::endl;
-        if( !gs->send() )
-          COUT(3) << "Problem adding partial gamestate to queue" << std::endl;
+    //this steers our network frequency
+    timeSinceLastUpdate_+=time;
+    if(timeSinceLastUpdate_>=NETWORK_PERIOD){
+      timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
+      //     COUT(3) << ".";
+      if(client_connection.isConnected() && isSynched_){
+        COUT(4) << "popping partial gamestate: " << std::endl;
+        packet::Gamestate *gs = gamestate.getGamestate();
+        if(gs){
+          COUT(4) << "client tick: sending gs " << gs << std::endl;
+          if( !gs->send() )
+            COUT(3) << "Problem adding partial gamestate to queue" << std::endl;
         // gs gets automatically deleted by enet callback
+        }
+        FunctionCallManager::sendCalls();
       }
-      FunctionCallManager::sendCalls();
+      ENetEvent *event;
+    // stop if the packet queue is empty
+      while(!(client_connection.queueEmpty())){
+        event = client_connection.getEvent();
+        COUT(5) << "tick packet size " << event->packet->dataLength << std::endl;
+        packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer);
+      // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler
+        bool b = packet->process();
+        assert(b);
+      }
+      if(gamestate.processGamestates())
+      {
+        if(!isSynched_)
+          isSynched_=true;
+      }
+      gamestate.cleanup();
     }
-    ENetEvent *event;
-    // stop if the packet queue is empty
-    while(!(client_connection.queueEmpty())){
-      event = client_connection.getEvent();
-      COUT(5) << "tick packet size " << event->packet->dataLength << std::endl;
-      packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer);
-      // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler
-      bool b = packet->process();
-      assert(b);
-    }
-    if(gamestate.processGamestates())
-    {
-      if(!isSynched_)
-        isSynched_=true;
-    }
-    gamestate.cleanup();
+
     return;
   }
Index: /code/branches/netp2/src/network/Client.h
===================================================================
--- /code/branches/netp2/src/network/Client.h	(revision 2964)
+++ /code/branches/netp2/src/network/Client.h	(revision 2965)
@@ -88,4 +88,5 @@
 
     bool gameStateFailure_;
+    float timeSinceLastUpdate_;
   };
 
Index: /code/branches/netp2/src/network/ClientConnection.cc
===================================================================
--- /code/branches/netp2/src/network/ClientConnection.cc	(revision 2964)
+++ /code/branches/netp2/src/network/ClientConnection.cc	(revision 2965)
@@ -58,5 +58,5 @@
 
   ClientConnection::ClientConnection(int port, const std::string& address) {
-    quit=false;
+    quit_=false;
     server=NULL;
     serverAddress = new ENetAddress();
@@ -67,5 +67,5 @@
 
   ClientConnection::ClientConnection(int port, const char *address) {
-    quit=false;
+    quit_=false;
     server=NULL;
     serverAddress = new ENetAddress();
@@ -107,5 +107,5 @@
 
   bool ClientConnection::closeConnection() {
-    quit=true;
+    quit_=true;
     //network_threads.join_all();
     receiverThread_->join();
@@ -151,15 +151,15 @@
       COUT(2) << "ClientConnection: could not create client host" << std::endl;
       // add some error handling here ==========================
-      quit=true;
+      quit_=true;
     }
     //connect to the server
     if(!establishConnection()){
       COUT(2) << "clientConn: receiver thread: could not establishConnection" << std::endl;
-      quit=true;
+      quit_=true;
       return;
     }
     event = new ENetEvent;
     //main loop
-    while(!quit){
+    while(!quit_){
       //std::cout << "connection loop" << std::endl;
       {
@@ -167,7 +167,8 @@
         if(enet_host_service(client, event, NETWORK_CLIENT_WAIT_TIME)<0){
           // we should never reach this point
-	        assert(0);
-          quit=true;
-          continue;
+// 	        assert(0);
+          printf("ClientConnection: ENet returned with an error!\n");
+          quit_=true;
+          break;
           // add some error handling here ========================
         }
@@ -185,5 +186,6 @@
         break;
       case ENET_EVENT_TYPE_DISCONNECT:
-        quit=true;
+        quit_=true;
+        printf("Received disconnect Packet from Server!\n");
         // server closed the connection
         return;
@@ -235,5 +237,5 @@
     }
     // handshake
-    while(enet_host_service(client, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && !quit){
+    while(enet_host_service(client, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && !quit_){
       if( event.type == ENET_EVENT_TYPE_CONNECT ){
         established=true;
Index: /code/branches/netp2/src/network/ClientConnection.h
===================================================================
--- /code/branches/netp2/src/network/ClientConnection.h	(revision 2964)
+++ /code/branches/netp2/src/network/ClientConnection.h	(revision 2965)
@@ -54,5 +54,5 @@
     const int NETWORK_CLIENT_MAX_CONNECTIONS = 5;
     const int NETWORK_CLIENT_WAIT_TIME = 10;
-    const int NETWORK_CLIENT_CONNECT_TIMEOUT = 10000; // miliseconds
+    const int NETWORK_CLIENT_CONNECT_TIMEOUT = 3000; // miliseconds
     const int NETWORK_CLIENT_CHANNELS = 2;
 
@@ -76,5 +76,6 @@
     //bool sendPackets(ENetEvent *event);
     bool waitEstablished(int milisec);
-    bool isConnected(){return established;}
+    inline bool isConnected(){return established;}
+    inline bool checkConnection(){ return !quit_ && isConnected(); }
   private:
     ClientConnection(const ClientConnection& copy); // not used
@@ -90,5 +91,5 @@
     ENetAddress *serverAddress;
     // quit-variable (communication with threads)
-    bool quit;
+    bool quit_;
     bool established;
     // clientlist
Index: /code/branches/netp2/src/network/ConnectionManager.cc
===================================================================
--- /code/branches/netp2/src/network/ConnectionManager.cc	(revision 2964)
+++ /code/branches/netp2/src/network/ConnectionManager.cc	(revision 2965)
@@ -71,5 +71,5 @@
     assert(instance_==0);
     instance_=this;
-    quit=false;
+    quit_=false;
     bindAddress = new ENetAddress();
     bindAddress->host = ENET_HOST_ANY;
@@ -80,5 +80,5 @@
     assert(instance_==0);
     instance_=this;
-    quit=false;
+    quit_=false;
     bindAddress = new ENetAddress();
     bindAddress->host = ENET_HOST_ANY;
@@ -89,5 +89,5 @@
     assert(instance_==0);
     instance_=this;
-    quit=false;
+    quit_=false;
     bindAddress = new ENetAddress();
     enet_address_set_host (bindAddress, address.c_str());
@@ -98,5 +98,5 @@
     assert(instance_==0);
     instance_=this;
-    quit=false;
+    quit_=false;
     bindAddress = new ENetAddress();
     enet_address_set_host (bindAddress, address);
@@ -105,5 +105,5 @@
 
   ConnectionManager::~ConnectionManager(){
-    if(!quit)
+    if(!quit_)
       quitListener();
     instance_=0;
@@ -129,5 +129,5 @@
 
   bool ConnectionManager::quitListener() {
-    quit=true;
+    quit_=true;
     receiverThread_->join();
     return true;
@@ -185,10 +185,10 @@
     if(server==NULL){
       // add some error handling here ==========================
-      quit=true;
+      quit_=true;
       return;
     }
 
     event = new ENetEvent;
-    while(!quit)
+    while(!quit_)
     {
       { //mutex scope
@@ -196,5 +196,6 @@
         if(enet_host_service(server, event, NETWORK_WAIT_TIMEOUT)<0){
           // we should never reach this point
-          quit=true;
+          printf("ConnectionManager: ENet returned with an error\n");
+          quit_=true;
           continue;
           printf("waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhh");
Index: /code/branches/netp2/src/network/ConnectionManager.h
===================================================================
--- /code/branches/netp2/src/network/ConnectionManager.h	(revision 2964)
+++ /code/branches/netp2/src/network/ConnectionManager.h	(revision 2965)
@@ -81,4 +81,5 @@
     void disconnectClient(ClientInformation *client);
     void syncClassid(unsigned int clientID);
+    bool checkReceiverThread(){ return !quit_; }
 
   private:
@@ -95,5 +96,5 @@
     ENetAddress *bindAddress;
 
-    bool quit; // quit-variable (communication with threads)
+    bool quit_; // quit-variable (communication with threads)
 
     boost::thread *receiverThread_;
Index: /code/branches/netp2/src/network/Host.h
===================================================================
--- /code/branches/netp2/src/network/Host.h	(revision 2964)
+++ /code/branches/netp2/src/network/Host.h	(revision 2965)
@@ -35,4 +35,8 @@
 
 namespace orxonox {
+
+  const int CLIENTID_SERVER = 0;
+  const unsigned int NETWORK_FREQUENCY = 25;
+  const float NETWORK_PERIOD = 1./NETWORK_FREQUENCY;
 
 /**
Index: /code/branches/netp2/src/network/Server.h
===================================================================
--- /code/branches/netp2/src/network/Server.h	(revision 2964)
+++ /code/branches/netp2/src/network/Server.h	(revision 2965)
@@ -51,7 +51,4 @@
 namespace orxonox
 {
-  const int CLIENTID_SERVER = 0;
-  const unsigned int NETWORK_FREQUENCY = 25;
-  const float NETWORK_PERIOD = 1./NETWORK_FREQUENCY;
 
   /**
