| 1 |
#ifndef AWS_READ_WRITE_TEST_HANDLER |
| 2 |
#define AWS_READ_WRITE_TEST_HANDLER |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <aws/io/io.h> |
| 9 |
|
| 10 |
#include <aws/common/task_scheduler.h> |
| 11 |
|
| 12 |
struct aws_atomic_var; |
| 13 |
struct aws_byte_buf; |
| 14 |
struct aws_channel_handler; |
| 15 |
struct aws_channel_slot; |
| 16 |
struct aws_condition_variable; |
| 17 |
|
| 18 |
typedef struct aws_byte_buf(rw_handler_driver_fn)( |
| 19 |
struct aws_channel_handler *handler, |
| 20 |
struct aws_channel_slot *slot, |
| 21 |
struct aws_byte_buf *data_read, |
| 22 |
void *ctx); |
| 23 |
|
| 24 |
struct aws_channel_handler *rw_handler_new( |
| 25 |
struct aws_allocator *allocator, |
| 26 |
rw_handler_driver_fn *on_read, |
| 27 |
rw_handler_driver_fn *on_write, |
| 28 |
bool event_loop_driven, |
| 29 |
size_t window, |
| 30 |
void *ctx); |
| 31 |
|
| 32 |
void rw_handler_enable_wait_on_destroy( |
| 33 |
struct aws_channel_handler *handler, |
| 34 |
struct aws_atomic_var *destroy_called, |
| 35 |
struct aws_condition_variable *condition_variable); |
| 36 |
|
| 37 |
void rw_handler_write(struct aws_channel_handler *handler, struct aws_channel_slot *slot, struct aws_byte_buf *buffer); |
| 38 |
|
| 39 |
void rw_handler_write_with_callback( |
| 40 |
struct aws_channel_handler *handler, |
| 41 |
struct aws_channel_slot *slot, |
| 42 |
struct aws_byte_buf *buffer, |
| 43 |
aws_channel_on_message_write_completed_fn *on_completion, |
| 44 |
void *user_data); |
| 45 |
|
| 46 |
void rw_handler_trigger_read(struct aws_channel_handler *handler, struct aws_channel_slot *slot); |
| 47 |
|
| 48 |
bool rw_handler_shutdown_called(struct aws_channel_handler *handler); |
| 49 |
|
| 50 |
bool rw_handler_increment_read_window_called(struct aws_channel_handler *handler); |
| 51 |
|
| 52 |
void rw_handler_trigger_increment_read_window( |
| 53 |
struct aws_channel_handler *handler, |
| 54 |
struct aws_channel_slot *slot, |
| 55 |
size_t window_update); |
| 56 |
|
| 57 |
void increment_read_window_task(void *arg, enum aws_task_status task_status); |
| 58 |
|
| 59 |
int rw_handler_last_error_code(struct aws_channel_handler *handler); |
| 60 |
|
| 61 |
#endif |