summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-12-28 23:48:16 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-12-28 23:48:16 +0100
commit945887004432a7634ce096a7c3744b42ae2ab987 (patch)
treeccd57652bd50c9832f468e7c487180bea68d26c8
parent6d8bfa8360165097a2a5ddd22084e04fc048607b (diff)
Specify endpoint in HTTPServer constructor.
-rw-r--r--httpd.cpp2
-rw-r--r--httpd.h2
-rw-r--r--main.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/httpd.cpp b/httpd.cpp
index 203f4e0..0c1015d 100644
--- a/httpd.cpp
+++ b/httpd.cpp
@@ -43,7 +43,7 @@ void HTTPConnection::start() {
boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
}
-HTTPServer::HTTPServer(boost::asio::io_service& io_service) : acceptor_(io_service, tcp::endpoint(tcp::v4(), 8000)) {
+HTTPServer::HTTPServer(boost::asio::io_service& io_service, const tcp::endpoint& endpoint) : acceptor_(io_service, endpoint) {
start_accept();
}
diff --git a/httpd.h b/httpd.h
index 34866aa..f9c0930 100644
--- a/httpd.h
+++ b/httpd.h
@@ -31,7 +31,7 @@ class HTTPServer {
tcp::acceptor acceptor_;
public:
- HTTPServer(boost::asio::io_service& io_service);
+ HTTPServer(boost::asio::io_service& io_service, const tcp::endpoint& endpoint);
};
#endif
diff --git a/main.cpp b/main.cpp
index 2c0ada7..c102a5b 100644
--- a/main.cpp
+++ b/main.cpp
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
encoder::init();
boost::asio::io_service io_service;
- HTTPServer httpd(io_service);
+ HTTPServer httpd(io_service, tcp::endpoint(tcp::v6(), 8000));
std::vector<boost::shared_ptr<boost::thread> > threads;
for(std::size_t i = 0; i < 10; i++) {
boost::shared_ptr<boost::thread> thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service)));