websocket fix, issue 13

This commit is contained in:
pravin-battu 2020-07-02 13:34:29 -03:00
parent a76b9ff81c
commit 0cf6f461b6
2 changed files with 11 additions and 1 deletions

View file

@ -41,6 +41,9 @@ namespace fc { namespace http {
typedef std::function<void(const websocket_connection_ptr&)> 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;

View file

@ -1,3 +1,4 @@
#include <fc/network/http/websocket.hpp>
#include <websocketpp/config/asio_client.hpp>
#include <websocketpp/config/asio.hpp>
@ -733,4 +734,4 @@ namespace fc { namespace http {
return my->_connection;
} FC_CAPTURE_AND_RETHROW( (uri) ) }
} } // fc::http
} } // fc::http