25 #ifndef EXT_TCP_UTILS_H_
26 #define EXT_TCP_UTILS_H_
29 #include "../kaa_error.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.
on_dns_resolve_failed_fn on_resolve_failed
ext_tcp_socket_io_errors_t
The target host information which is used for the DNS resolve needs.
on_dns_resolve_complete_fn on_host_resolved
sndc_socklen_t kaa_socklen_t
kaa_error_t(* on_dns_resolve_failed_fn)(void *context)
The callback for negative host resolve results.
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.
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. See ext_tcp_utils_gethostbyaddr.
Interface for the deferred DNS results.
struct sndc_sockaddr kaa_sockaddr_t
ext_tcp_utils_function_return_state_t
ext_tcp_utils_function_return_state_t ext_tcp_utils_gethostbyaddr(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 hostname of the target host.
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.
kaa_error_t ext_tcp_utils_tcp_socket_close(kaa_fd_t fd)
Closes the given socket.