Changeset 1279 for code/branches/merge/src
- Timestamp:
- May 15, 2008, 11:42:50 AM (17 years ago)
- Location:
- code/branches/merge/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/merge/src/network/ClientConnection.cc
r1264 r1279 42 42 #include <iostream> 43 43 // boost.thread library for multithreading support 44 #include <boost/thread/thread.hpp>45 44 #include <boost/bind.hpp> 46 45 … … 50 49 namespace network 51 50 { 52 static boost::thread_group network_threads;51 //static boost::thread_group network_threads; 53 52 54 53 ClientConnection::ClientConnection(int port, std::string address) { … … 96 95 97 96 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)); 99 99 // wait 10 seconds for the connection to be established 100 100 return waitEstablished(10000); … … 103 103 bool ClientConnection::closeConnection() { 104 104 quit=true; 105 network_threads.join_all(); 105 //network_threads.join_all(); 106 receiverThread_->join(); 106 107 established=false; 107 108 return true; … … 179 180 continue; 180 181 } 182 //receiverThread_->yield(); 181 183 } 182 184 // now disconnect -
code/branches/merge/src/network/ClientConnection.h
r1264 r1279 45 45 #include <string> 46 46 #include <enet/enet.h> 47 #include <boost/thread/thread.hpp> 47 48 48 49 #include "PacketBuffer.h" … … 93 94 // clientlist 94 95 ENetPeer *server; 96 boost::thread *receiverThread_; 95 97 }; 96 98
Note: See TracChangeset
for help on using the changeset viewer.