summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-23 12:39:27 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-23 12:39:27 +0100
commitc2709fbe5438da124b2d493cb714a6c58720cf5b (patch)
tree015607895cba76f9b8bcddf6fae72cb7c62e3cb3 /src/lib
parent365f830b4c65b2d872106a14f57d28cef4a179cd (diff)
Command-line option to specify servomatic_cli threads.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/server.cc4
-rw-r--r--src/lib/server.h2
-rw-r--r--src/lib/util.cc8
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));
+}