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

Only listening on localhost

This commit is contained in:
Ralf Ramsauer 2015-05-18 22:22:59 +02:00
parent f99ed93f29
commit 8b2a0ea4ca

View File

@ -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)
{