client-c  0.8.1
kaa_tcp_channel.h
Go to the documentation of this file.
1 
18 #ifndef KAA_TCP_CHANNEL_H_
19 #define KAA_TCP_CHANNEL_H_
20 
21 #include "../../kaa_error.h"
22 #include "../../platform/ext_transport_channel.h"
23 #include "../../platform/defaults.h"
24 #include "../../platform/ext_tcp_utils.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
31 typedef enum {
35 } fd_event_t;
36 
37 
38 typedef enum {
43 
44 
57 typedef kaa_error_t (*on_kaa_tcp_channel_event_fn)(void *context
58  , kaa_tcp_channel_event_t event_type
59  , kaa_fd_t fd);
60 
61 
73  , kaa_logger_t *logger
74  , kaa_service_t *supported_services
75  , size_t supported_service_count);
76 
77 
88  , kaa_fd_t *fd_p);
89 
90 
101  , fd_event_t event_type);
102 
103 
113  , fd_event_t event_type);
114 
115 
127  , uint16_t *max_timeout);
128 
129 
141 
142 
155  , on_kaa_tcp_channel_event_fn callback
156  , void *context);
157 
166 
167 #ifdef __cplusplus
168 } /* extern "C" */
169 #endif
170 
171 
172 #endif /* KAA_TCP_CHANNEL_H_ */
kaa_error_t kaa_tcp_channel_create(kaa_transport_channel_interface_t *self, kaa_logger_t *logger, kaa_service_t *supported_services, size_t supported_service_count)
Creates a Kaa TCP channel instance.
kaa_error_t
Definition: kaa_error.h:31
Interface for a client transport channel implementation.
kaa_error_t kaa_tcp_channel_process_event(kaa_transport_channel_interface_t *self, fd_event_t event_type)
Notifies the channel instance about the I/O event.
kaa_service_t
Types of Kaa platform services.
Definition: kaa_common.h:57
kaa_error_t kaa_tcp_channel_disconnect(kaa_transport_channel_interface_t *self)
Disconnects the current channel.
struct kaa_logger_t kaa_logger_t
Definition: kaa_context.h:85
bool kaa_tcp_channel_is_ready(kaa_transport_channel_interface_t *self, fd_event_t event_type)
Checks whether the given channel instance is ready to handle the specified event. ...
kaa_error_t kaa_tcp_channel_check_keepalive(kaa_transport_channel_interface_t *self)
Checks whether a keepalive timeout occurred. If so, sends a keepalive message to the server...
kaa_tcp_channel_event_t
kaa_error_t(* on_kaa_tcp_channel_event_fn)(void *context, kaa_tcp_channel_event_t event_type, kaa_fd_t fd)
Notifies about the current channel's state. Used by kaa_tcp_channel_set_socket_events_callback ...
kaa_error_t kaa_tcp_channel_get_max_timeout(kaa_transport_channel_interface_t *self, uint16_t *max_timeout)
Retrieves the maximum timeout for the multiplexing I/O like select/poll. Used for kaa_tcp_channel_che...
kaa_error_t kaa_tcp_channel_get_descriptor(kaa_transport_channel_interface_t *self, kaa_fd_t *fd_p)
Retrieves the socket descriptor from the given channel instance.
int kaa_fd_t
Definition: cc32xx_sock.h:74
kaa_error_t kaa_tcp_channel_set_socket_events_callback(kaa_transport_channel_interface_t *self, on_kaa_tcp_channel_event_fn callback, void *context)
Sets the callback for the current channel connection state.
fd_event_t