Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 15, 2008, 11:42:50 AM (17 years ago)
Author:
scheusso
Message:

adapted boost threads in clientconnection
added trap to runscript (xset r, autorepeat)
had to change assff back to assf3 due to some network issues

Location:
code/branches/merge/src/network
Files:
2 edited

Legend:

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

    r1264 r1279  
    4242#include <iostream>
    4343// boost.thread library for multithreading support
    44 #include <boost/thread/thread.hpp>
    4544#include <boost/bind.hpp>
    4645
     
    5049namespace network
    5150{
    52   static boost::thread_group network_threads;
     51  //static boost::thread_group network_threads;
    5352
    5453  ClientConnection::ClientConnection(int port, std::string address) {
     
    9695
    9796  bool ClientConnection::createConnection() {
    98     network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
     97    receiverThread_ = new boost::thread(boost::bind(&ClientConnection::receiverThread, this));
     98    //network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
    9999    // wait 10 seconds for the connection to be established
    100100    return waitEstablished(10000);
     
    103103  bool ClientConnection::closeConnection() {
    104104    quit=true;
    105     network_threads.join_all();
     105    //network_threads.join_all();
     106    receiverThread_->join();
    106107    established=false;
    107108    return true;
     
    179180        continue;
    180181      }
     182      //receiverThread_->yield();
    181183    }
    182184    // now disconnect
  • code/branches/merge/src/network/ClientConnection.h

    r1264 r1279  
    4545#include <string>
    4646#include <enet/enet.h>
     47#include <boost/thread/thread.hpp>
    4748
    4849#include "PacketBuffer.h"
     
    9394    // clientlist
    9495    ENetPeer *server;
     96    boost::thread *receiverThread_;
    9597  };
    9698
Note: See TracChangeset for help on using the changeset viewer.