![]() |
ImFusion C++ SDK 4.4.0
|
#include <ImFusion/Stream/Network/ClientConnectionBase.h>
Base class providing an interface for client communication. More...
Base class providing an interface for client communication.
Supports connecting to and disconnecting from a server, such as WebsocketClient and TCPSocketClient.
Public Member Functions | |
| virtual bool | connect (int connectionTimeoutMs=100)=0 |
| Connects to the server. | |
| virtual bool | isConnected () const =0 |
| Returns true if a handshake has been completed and the connection is open. | |
| virtual void | disconnect ()=0 |
| Disconnects from the server and deletes the session. | |
| Public Member Functions inherited from ImFusion::Network::TypedConnectionBase< Payload > | |
| virtual void | sendMessage (Payload message)=0 |
| Sends a message over the network connection. | |
Additional Inherited Members | |
| Public Attributes inherited from ImFusion::Network::TypedConnectionBase< Payload > | |
| ProtectedSignal< std::shared_ptr< const Payload > > | signalNewMessage |
| Signal emitted when a new message is received. | |
| ProtectedSignal< std::shared_ptr< const Payload > > | signalMessageSent |
| Signal emitted when a message is sent. | |
|
pure virtual |
Connects to the server.
Returns false on failure or if the connection times out after connectionTimeoutMs milliseconds.
Implemented in ImFusion::Network::TCPSocketClient< Payload >, ImFusion::Network::WebsocketClient< Payload >, ImFusion::Network::WebsocketClient< ImFusion::ByteBuffer >, and ImFusion::Network::WebsocketClient< std::string >.
|
pure virtual |
Returns true if a handshake has been completed and the connection is open.
Implemented in ImFusion::Network::TCPSocketClient< Payload >, ImFusion::Network::WebsocketClient< Payload >, ImFusion::Network::WebsocketClient< ImFusion::ByteBuffer >, and ImFusion::Network::WebsocketClient< std::string >.
|
pure virtual |
Disconnects from the server and deletes the session.
Implemented in ImFusion::Network::TCPSocketClient< Payload >, ImFusion::Network::WebsocketClient< Payload >, ImFusion::Network::WebsocketClient< ImFusion::ByteBuffer >, and ImFusion::Network::WebsocketClient< std::string >.