diff --git a/include/fc/network/http/server.hpp b/include/fc/network/http/server.hpp index 711ea50..a90764e 100644 --- a/include/fc/network/http/server.hpp +++ b/include/fc/network/http/server.hpp @@ -45,7 +45,7 @@ namespace fc { namespace http { fc::shared_ptr my; }; - void listen( uint16_t p ); + void listen( const fc::ip::endpoint& p ); /** * Set the callback to be called for every http request made. diff --git a/src/network/http/http_server.cpp b/src/network/http/http_server.cpp index 1f7578d..678f4db 100644 --- a/src/network/http/http_server.cpp +++ b/src/network/http/http_server.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -46,7 +47,7 @@ namespace fc { namespace http { { public: impl(){} - impl(uint16_t p ) { + impl(const fc::ip::endpoint& p ) { tcp_serv.listen(p); accept_complete = fc::async([this](){ this->accept_loop(); }); } @@ -86,14 +87,14 @@ namespace fc { namespace http { server::server(){} - server::server( uint16_t port ) :my( new impl(port) ){} + server::server( uint16_t port ) :my( new impl(fc::ip::endpoint( fc::ip::address(),port)) ){} server::server( server&& s ):my(fc::move(s.my)){} server& server::operator=(server&& s) { fc_swap(my,s.my); return *this; } server::~server(){} - void server::listen( uint16_t p ) { + void server::listen( const fc::ip::endpoint& p ) { my.reset( new impl(p) ); }