diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/server.cc | 4 | ||||
| -rw-r--r-- | src/lib/server.h | 2 | ||||
| -rw-r--r-- | src/lib/util.cc | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc index ff784db5a..a62763447 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -181,9 +181,9 @@ Server::worker_thread () } void -Server::run () +Server::run (int num_threads) { - int const num_threads = Config::instance()->num_local_encoding_threads (); + cout << "Server starting with " << num_threads << " threads.\n"; for (int i = 0; i < num_threads; ++i) { _worker_threads.push_back (new thread (bind (&Server::worker_thread, this))); diff --git a/src/lib/server.h b/src/lib/server.h index 58cfe0b3f..fac440a76 100644 --- a/src/lib/server.h +++ b/src/lib/server.h @@ -76,7 +76,7 @@ class Server public: Server (Log* log); - void run (); + void run (int num_threads); private: void worker_thread (); diff --git a/src/lib/util.cc b/src/lib/util.cc index 1478bab2e..e79c7cd1c 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -518,5 +518,9 @@ colour_lut_index_to_name (int index) return ""; } - - +int +read_with_timeout (boost::asio::ip::tcp::socket* socket, uint8_t* data, int size) +{ + + return asio::read (socket, asio::buffer (data, size)); +} |
