diff --git a/include/fc/network/http/websocket.hpp b/include/fc/network/http/websocket.hpp index a42c1f8..01ed677 100755 --- a/include/fc/network/http/websocket.hpp +++ b/include/fc/network/http/websocket.hpp @@ -41,6 +41,9 @@ namespace fc { namespace http { typedef std::function on_connection_handler; + // Recommended changes in the future + // TODO websocket_tls_server and websocket_server have almost the same interface and implementation, + // better refactor to remove duplicate code and to avoid undesired or unnecessary differences class websocket_server { public: @@ -59,6 +62,9 @@ namespace fc { namespace http { }; + // Recommended changes in the future + // TODO websocket_tls_server and websocket_server have almost the same interface and implementation, + // better refactor to remove duplicate code and to avoid undesired or unnecessary differences class websocket_tls_server { public: @@ -70,6 +76,9 @@ namespace fc { namespace http { void listen( uint16_t port ); void listen( const fc::ip::endpoint& ep ); void start_accept(); + uint16_t get_listening_port(); + void stop_listening(); + void close(); private: friend class detail::websocket_tls_server_impl; diff --git a/src/network/http/websocket.cpp b/src/network/http/websocket.cpp index 6440dd6..3463b95 100755 --- a/src/network/http/websocket.cpp +++ b/src/network/http/websocket.cpp @@ -1,3 +1,4 @@ + #include #include #include @@ -733,4 +734,4 @@ namespace fc { namespace http { return my->_connection; } FC_CAPTURE_AND_RETHROW( (uri) ) } -} } // fc::http +} } // fc::http \ No newline at end of file