added listen on a specific endpoint/port pair
This commit is contained in:
parent
09e645448d
commit
e506e4f4be
2 changed files with 6 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue