added listen on a specific endpoint/port pair

This commit is contained in:
Daniel Larimer 2015-03-30 16:56:28 -04:00
parent 09e645448d
commit e506e4f4be
2 changed files with 6 additions and 0 deletions

View file

@ -3,6 +3,7 @@
#include <memory>
#include <string>
#include <fc/any.hpp>
#include <fc/network/ip.hpp>
namespace fc { namespace http {
namespace detail {
@ -38,6 +39,7 @@ namespace fc { namespace http {
void on_connection( const on_connection_handler& handler);
void listen( uint16_t port );
void listen( const fc::ip::endpoint& ep );
void start_accept();
private:

View file

@ -200,6 +200,10 @@ namespace fc { namespace http {
{
my->_server.listen(port);
}
void websocket_server::listen( const fc::ip::endpoint& ep )
{
my->_server.listen( boost::asio::ip::tcp::endpoint( boost::asio::ip::address_v4(uint32_t(ep.get_address())),ep.port()) );
}
void websocket_server::start_accept() {
my->_server.start_accept();