async_select  2.0.2
async_select
async_select.h
Go to the documentation of this file.
1 /*
2  * C
3  *
4  * Copyright 2017-2020 MicroEJ Corp. All rights reserved.
5  * This library is provided in source code for use, modification and test, subject to license terms.
6  * Any modification of the source code will break MicroEJ Corp. warranties on the whole library.
7  */
8 
9 #ifndef ASYNC_SELECT_H
10 #define ASYNC_SELECT_H
11 
20 #include <stdint.h>
21 #include <sni.h>
22 
23 #ifdef __cplusplus
24  extern "C" {
25 #endif
26 
28 typedef enum
29 {
30  SELECT_READ,
31  SELECT_WRITE
33 
42 int32_t non_blocking_select(int32_t fd, SELECT_Operation operation);
43 
57 int32_t async_select(int32_t fd, SELECT_Operation operation, int64_t timeout_ms, SNI_callback callback);
58 
65 int32_t async_select_init(void);
66 
72 void async_select_notify_closed_fd(int32_t fd);
73 
74 #ifdef __cplusplus
75  }
76 #endif
77 
78 #endif // ASYNC_SELECT_H
void async_select_notify_closed_fd(int32_t fd)
Notifies the async_select task that a file descriptor has been closed. On some systems the close of a...
Definition: async_select.c:236
int32_t async_select_init(void)
Initialize the async_select component. This function must be called prior to any call of async_select...
int32_t async_select(int32_t fd, SELECT_Operation operation, int64_t timeout_ms, SNI_callback callback)
Executes asynchronously a select() operation for the given file descriptor. This function will suspen...
Definition: async_select.c:174
SELECT_Operation
Select operations list.
Definition: async_select.h:28
int32_t non_blocking_select(int32_t fd, SELECT_Operation operation)
Execute a select() for the given file descriptor and operation without blocking.
Definition: async_select.c:136