![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Stream/Network/ClientConnectionBase.h>
Base class providing an interface for client communication. More...
Inheritance diagram for ClientConnectionBase< Payload >: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 TypedConnectionBase< Payload > | |
| virtual void | sendMessage (Payload message)=0 |
| Sends a message over the network connection. | |
Additional Inherited Members | |
Public Attributes inherited from TypedConnectionBase< Payload > | |
| ProtectedSignal< std::shared_ptr< Payload > > | signalNewMessage |
| Signal emitted when a new message is received. | |
| ProtectedSignal< std::shared_ptr< 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 TCPSocketClient< Payload >, WebsocketClient< Payload >, WebsocketClient< ImFusion::ByteBuffer >, and WebsocketClient< std::string >.
|
pure virtual |
Returns true if a handshake has been completed and the connection is open.
Implemented in TCPSocketClient< Payload >, WebsocketClient< Payload >, WebsocketClient< ImFusion::ByteBuffer >, and WebsocketClient< std::string >.
|
pure virtual |
Disconnects from the server and deletes the session.
Implemented in TCPSocketClient< Payload >, WebsocketClient< Payload >, WebsocketClient< ImFusion::ByteBuffer >, and WebsocketClient< std::string >.