Header: | #include <CuteClient.h> #include <CuteServer.h> |
class | ConnectionInfo |
class | DataStream |
union | Error |
struct | ErrorInfo |
class | IConnectionInformation |
class | IErrorHandler |
enum class | ConnectionError { InvalidProxyHeader, ProxyHeaderReadTimedOut, SslHandshakeTimedOut, WebSocketHandshakeTimedOut, CuteHandshakeTimedOut, …, NotRegisteredArgument } |
enum class | ErrorType { Socket, SSL, Connection } |
int | registerType() |
void | setErrorHandler(Cute::IErrorHandler *errorHandlerInstance) |
Common classes used by both client and server SDKs.
Classes used by client SDK.
Classes used by server SDK.
The Cute::ConnectionInfo holds connection information when handling errors. More...
The Cute::DataStream allows custom types to be streamed in remote signal slot connections as well as direct remote slot calls. More...
Cute::ErrorInfo holds information about the error that happened in the connection. More...
The Cute::IConnectionInformation class is an interface allowing interaction with the established connection. More...
The Cute::IErrorHandler is an interface that error handlers must implement. More...
This enum type specifies the type of the error that happened in the connection:
Constant | Value | Description |
---|---|---|
Cute::ConnectionError::InvalidProxyHeader | 0 | Invalid proxy header. |
Cute::ConnectionError::ProxyHeaderReadTimedOut | 1 | Proxy header read timed out. |
Cute::ConnectionError::SslHandshakeTimedOut | 2 | SSL handshake timed out. |
Cute::ConnectionError::WebSocketHandshakeTimedOut | 3 | WebSocket handshake timed out. |
Cute::ConnectionError::CuteHandshakeTimedOut | 4 | Cute handshake timed out. |
Cute::ConnectionError::CuteHandshakeFailed | 5 | Cute handshake failed. |
Cute::ConnectionError::RequestTimedOut | 6 | Request timed out. |
Cute::ConnectionError::ConnectionTimedOut | 7 | Connection timed out. |
Cute::ConnectionError::MessageIntegrityCheckFailed | 8 | Message integrity check failed. |
Cute::ConnectionError::InvalidHttpRequest | 9 | Invalid http request. |
Cute::ConnectionError::HttpHandlerNotFound | 10 | Http handler was not found |
Cute::ConnectionError::InvalidMessage | 11 | Invalid message. |
Cute::ConnectionError::RemoteObjectNotFound | 12 | Remote object not found. |
Cute::ConnectionError::RemoteSignalNotFound | 13 | Remote signal not found. |
Cute::ConnectionError::RemoteSlotNotFound | 14 | Remote slot not found. |
Cute::ConnectionError::TooBigSignal | 15 | Signal is too big (has more than 10 arguments). |
Cute::ConnectionError::InvalidObject | 16 | Invalid object. |
Cute::ConnectionError::InvalidSignal | 17 | Invalid signal. |
Cute::ConnectionError::InvalidSlot | 18 | Invalid slot. |
Cute::ConnectionError::IncompatibleSignalSlot | 19 | Signal is incompatible to slot. |
Cute::ConnectionError::InvalidSignalEmitter | 20 | Signal emitter is invalid. |
Cute::ConnectionError::RemoteSlotRaisedException | 21 | Remote slot raised an exception. |
Cute::ConnectionError::TooManyRemoteObjectsPerConnection | 22 | Too many remote objects per connection. |
Cute::ConnectionError::TooManyRemoteSignalSlotConnections | 23 | Too many remote signal slot connections. |
Cute::ConnectionError::InvalidRemoteObjectUrl | 24 | Remote object url is not valid. |
Cute::ConnectionError::ConnectionDropped | 25 | Connection dropped. |
Cute::ConnectionError::ConnectedReceiverNotFound | 26 | Connected receiver not found. |
Cute::ConnectionError::InvalidArgType | 27 | Argument is invalid. It is a pointer or reference to a pointer (**, *&, *). |
Cute::ConnectionError::NotRegisteredArgument | 28 | Argument is not registered. Use Cute::registerType to register a custom type. |
This enum type specifies the type of the error that happened in the connection:
Constant | Value | Description |
---|---|---|
Cute::ErrorType::Socket | 0 | Error happened in socket (QAbstractSocket::SocketError). |
Cute::ErrorType::SSL | 1 | Error happened in SSL handshake (QSslError::SslError). |
Cute::ErrorType::Connection | 2 | Cute connection error (Cute::ConnectionError). |
This function registers the type T to Cute so that it can be used on remote signals and slots. T must be fully defined and T must be declared with Q_DECLARE_METATYPE(). Returns the meta type Id.
Sets errorHandlerInstance as the instance responsible for receiving errors. Although errors may originate from different threads, Cute Server serializes error reporting to this instance. Thus, implementors do not have to worry about making handler thread-safe. Any previously set handler is destroyed. This function is thread-safe.
Note that remote objects are compiled into a shared library that is loaded by server during runtime. Thus, to set the error handler, setErrorHandler can be called in a function tagged with the constructor attribute. Both GCC and Clang support attributes. setErrorHandler can be called during library loading as shown below:
// function to run when library loads __attribute__((constructor)) static void initialize_remote_objects_lib() { // MyErrorHandler is a class that inherits IErrorHandler Cute::setErrorHandler(new MyErrorHandler); }