25 #ifndef EXT_TCP_UTILS_H_
26 #define EXT_TCP_UTILS_H_
28 #include <platform/sock.h>
35 #define KAA_TCP_SOCKET_NOT_SET -1
194 ,
size_t *bytes_written);
213 ,
size_t *bytes_read);
ext_tcp_socket_io_errors_t ext_tcp_utils_tcp_socket_read(kaa_fd_t fd, char *buffer, size_t buffer_size, size_t *bytes_read)
Reads bytes from the given socket.
ext_tcp_socket_io_errors_t ext_tcp_utils_tcp_socket_write(kaa_fd_t fd, const char *buffer, size_t buffer_size, size_t *bytes_written)
Writes the buffer into the given socket.
Definition: ext_tcp_utils.h:55
Definition: ext_tcp_utils.h:49
ext_tcp_utils_function_return_state_t ext_tcp_utils_getaddrbyhost(kaa_dns_resolve_listener_t *resolve_listener, const kaa_dns_resolve_info_t *resolve_props, kaa_sockaddr_t *result, kaa_socklen_t *result_size)
Resolves the address of the target host.
on_dns_resolve_failed_fn on_resolve_failed
Called when the host resolve was failed.
Definition: ext_tcp_utils.h:94
ext_tcp_socket_io_errors_t
Definition: ext_tcp_utils.h:53
Definition: ext_tcp_utils.h:54
size_t hostname_length
The target's hostname length.
Definition: ext_tcp_utils.h:105
uint16_t port
The target's port.
Definition: ext_tcp_utils.h:106
kaa_error_t
Definition: kaa_error.h:31
The target host information which is used for the DNS resolve needs.
Definition: ext_tcp_utils.h:103
Definition: ext_tcp_utils.h:48
Definition: ext_tcp_utils.h:39
Definition: ext_tcp_utils.h:40
Definition: ext_tcp_utils.h:56
on_dns_resolve_complete_fn on_host_resolved
Called when the host is successfully resolved.
Definition: ext_tcp_utils.h:93
Definition: ext_tcp_utils.h:41
kaa_error_t(* on_dns_resolve_failed_fn)(void *context)
The callback for negative host resolve results.
Definition: ext_tcp_utils.h:83
char * hostname
The target's hostname.
Definition: ext_tcp_utils.h:104
kaa_error_t ext_tcp_utils_set_sockaddr_port(kaa_sockaddr_t *addr, uint16_t port)
Sets a new port value to the given sockaddr structure.
Definition: ext_tcp_utils.h:42
ext_tcp_socket_state_t ext_tcp_utils_tcp_socket_check(kaa_fd_t fd, const kaa_sockaddr_t *destination, kaa_socklen_t destination_size)
Checks the state of the given socket descriptor.
kaa_error_t(* on_dns_resolve_complete_fn)(void *context, const kaa_sockaddr_t *addr, kaa_socklen_t addr_size)
The callback for successful DNS results.
Definition: ext_tcp_utils.h:69
Interface for the deferred DNS results.
Definition: ext_tcp_utils.h:91
ext_tcp_utils_function_return_state_t
Definition: ext_tcp_utils.h:38
ext_tcp_socket_state_t
Definition: ext_tcp_utils.h:46
void * context
The context to pass to all functions below.
Definition: ext_tcp_utils.h:92
kaa_error_t ext_tcp_utils_open_tcp_socket(kaa_fd_t *fd, const kaa_sockaddr_t *destination, kaa_socklen_t destination_size)
Creates a non-blocking TCP socket and connects it to the given target host.
Definition: ext_tcp_utils.h:47
kaa_error_t ext_tcp_utils_tcp_socket_close(kaa_fd_t fd)
Closes the given socket.