# Connector.hpp
This File On Github
Ask A Question
API: latest
module: oatpp-websocket
#include "oatpp-websocket/Connector.hpp"
# Connector
Helper class to do client websocket connect.
namespace oatpp { namespace websocket {
class Connector {}
}}
# Typedefs
Type | Name | Summary |
---|---|---|
oatpp::data::stream::IOStream | Connection | Convenience typedef for oatpp::data::stream::IOStream. |
oatpp::async::Action | Action | Convenience typedef for oatpp::async::Action. |
oatpp::web::protocol::http::Headers | Headers | Convenience typedef for oatpp::web::protocol::http::Headers. |
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | Connector | Constructor. |
std::shared_ptr<Connector> | createShared | Create shared Connector. |
provider::ResourceHandle<Connection> | connect | Connect to server, do websocket-handshake and return Connection which can be then passed to WebSocket constructor. |
CoroutineStarterForResult<const provider::ResourceHandle<Connection>&> | connectAsync | Connect to server, do websocket-handshake and return Connection which can be then passed to WebSocket constructor. |
# Connector::Connection
Convenience typedef for oatpp::data::stream::IOStream.
typedef oatpp::data::stream::IOStream Connection
# Connector::Action
Convenience typedef for oatpp::async::Action.
typedef oatpp::async::Action Action
# Connector::Headers
Convenience typedef for oatpp::web::protocol::http::Headers.
typedef oatpp::web::protocol::http::Headers Headers
# Connector::Connector
Constructor.
- @param connectionProvider - oatpp::network::ClientConnectionProvider.
Connector(const std::shared_ptr<oatpp::network::ClientConnectionProvider>& connectionProvider)
# Connector::createShared
Create shared Connector.
- @param connectionProvider - oatpp::network::ClientConnectionProvider.
- @return -
std::shared_ptr
to Connector.
static std::shared_ptr<Connector> createShared(const std::shared_ptr<oatpp::network::ClientConnectionProvider>& connectionProvider)
# Connector::connect
Connect to server, do websocket-handshake and return Connection which can be then passed to WebSocket constructor.
(Blocking call)
- @param path - path to websocket endpoint.
- @param headers - websocket connect request headers.
- @return - Connector::Connection.
provider::ResourceHandle<Connection> connect(const oatpp::String& path, const Headers& headers =
# Connector::connectAsync
Connect to server, do websocket-handshake and return Connection which can be then passed to WebSocket constructor.
(Async call)
- @param path - path to websocket endpoint.
- @param headers - websocket connect request headers.
- @return - oatpp::async::Action.
CoroutineStarterForResult<const provider::ResourceHandle<Connection>&> connectAsync(const oatpp::String& path, const Headers& headers =