Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
kaa_tcp_channel.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef KAA_TCP_CHANNEL_H_
19 #define KAA_TCP_CHANNEL_H_
20 
21 #include "kaa_error.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_extension_id *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_ */
Definition: kaa_tcp_channel.h:32
kaa_error_t
Definition: kaa_error.h:31
Interface for a client transport channel implementation.
Definition: ext_transport_channel.h:130
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_error_t kaa_tcp_channel_disconnect(kaa_transport_channel_interface_t *self)
Disconnects the current channel.
Kaa error codes.
kaa_extension_id
Kaa extensions.
Definition: kaa_common.h:35
struct kaa_logger_t kaa_logger_t
Definition: kaa_log.h:68
Definition: kaa_tcp_channel.h:41
Definition: kaa_tcp_channel.h:34
int kaa_fd_t
Definition: sock.h:74
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.
kaa_tcp_channel_event_t
Definition: kaa_tcp_channel.h:38
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.
Definition: kaa_tcp_channel.h:57
Definition: kaa_tcp_channel.h:40
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.
External interface for socket manipulations used by Kaa transport channel implementations.
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.
Definition: kaa_tcp_channel.h:39
kaa_error_t kaa_tcp_channel_create(kaa_transport_channel_interface_t *self, kaa_logger_t *logger, kaa_extension_id *supported_services, size_t supported_service_count)
Creates a Kaa TCP channel instance.
Definition: kaa_tcp_channel.h:33
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
Definition: kaa_tcp_channel.h:31