From 63d8cb51c9d392df8aea6a0cc61da77ef6310666 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Mon, 18 May 2015 22:22:59 +0200 Subject: [PATCH] Only listening on localhost --- doorlockd/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doorlockd/main.cpp b/doorlockd/main.cpp index 34b61df..58570a5 100644 --- a/doorlockd/main.cpp +++ b/doorlockd/main.cpp @@ -68,18 +68,17 @@ class server public: - server(boost::asio::io_service& io_service, short port) - : _acceptor(io_service, tcp::endpoint(tcp::v4(), port)), - _socket(io_service) - { - do_accept(); - } + server(boost::asio::io_service& io_service, short port) + : _acceptor(io_service, tcp::endpoint(boost::asio::ip::address::from_string("127.0.0.1"), port)), + _socket(io_service) + { + do_accept(); + } private: void do_accept() { - _acceptor.async_accept(_socket, [this](boost::system::error_code ec) {