![]() |
async_select
2.0.2
async_select
|
Asynchronous network select API. More...
#include <stdint.h>#include <sni.h>Go to the source code of this file.
Enumerations | |
| enum | SELECT_Operation { SELECT_READ, SELECT_WRITE } |
| Select operations list. | |
Functions | |
| int32_t | non_blocking_select (int32_t fd, SELECT_Operation operation) |
| Execute a select() for the given file descriptor and operation without blocking. More... | |
| 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 suspend the execution of the current Java thread using SNI_suspendCurrentJavaThreadWithCallback(). Once the select() succeeds the Java thread is resumed and the given SNI callback is called. More... | |
| int32_t | async_select_init (void) |
| Initialize the async_select component. This function must be called prior to any call of async_select(). More... | |
| 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 file descriptor does not unblock the select that's why we need to notify the async_select task. | |
Asynchronous network select API.
Definition in file async_select.h.
| 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 suspend the execution of the current Java thread using SNI_suspendCurrentJavaThreadWithCallback(). Once the select() succeeds the Java thread is resumed and the given SNI callback is called.
| [in] | fd | the file descriptor. |
| [in] | operation | the operation (read or write) we want to monitor with the select(). |
| [in] | timeout_ms | timeout in millisecond |
| [in] | the | SNI callback to call when the Java thread is resumed or timeout occurs. |
Executes asynchronously a select() operation for the given file descriptor. This function will suspend the execution of the current Java thread using SNI_suspendCurrentJavaThreadWithCallback(). Once the select() succeeds the Java thread is resumed and the given SNI callback is called.
This function will suspend the execution of the current Java thread using SNI_suspendCurrentJavaThreadWithCallback(). Once the select() succeeds the Java thread is resumed and the given SNI callback is called. *
| fd | the file descriptor. |
| operation | the operation (read or write) we want to monitor with the select(). |
| timeout_ms | timeout in millisecond |
| the | SNI callback to call when the Java thread is resumed or timeout occurs. |
Definition at line 174 of file async_select.c.
| int32_t async_select_init | ( | void | ) |
Initialize the async_select component. This function must be called prior to any call of async_select().
Definition at line 64 of file async_select_osal.c.
| int32_t non_blocking_select | ( | int32_t | fd, |
| SELECT_Operation | operation | ||
| ) |
Execute a select() for the given file descriptor and operation without blocking.
| [in] | fd | the file descriptor. |
| [in] | operation | the operation (read or write) we want to monitor with the select(). |
| fd | the file descriptor. |
| operation | the operation (read or write) we want to monitor with the select(). |
Definition at line 136 of file async_select.c.
1.8.12