1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 10:24:26 +01:00

Only listening on localhost

This commit is contained in:
Ralf Ramsauer 2015-05-18 22:22:59 +02:00
parent 3b8b1d0d53
commit 63d8cb51c9

View File

@ -68,18 +68,17 @@ class server
public: public:
server(boost::asio::io_service& io_service, short port) server(boost::asio::io_service& io_service, short port)
: _acceptor(io_service, tcp::endpoint(tcp::v4(), port)), : _acceptor(io_service, tcp::endpoint(boost::asio::ip::address::from_string("127.0.0.1"), port)),
_socket(io_service) _socket(io_service)
{ {
do_accept(); do_accept();
} }
private: private:
void do_accept() void do_accept()
{ {
_acceptor.async_accept(_socket, _acceptor.async_accept(_socket,
[this](boost::system::error_code ec) [this](boost::system::error_code ec)
{ {