blob: 39f8cc4b4de94de88e810c6d57115dac55c60476 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# nng_aio_begin
## NAME
nng_aio_begin --- begin asynchronous I/O operation
## SYNOPSIS
```c
#include <nng/nng.h>
bool nng_aio_begin(nng_aio *aio);
```
## DESCRIPTION
The `nng_aio_begin()` function is called by the I/O provider to indicate that
it is going to process the operation.
The function may return `false`, indicating that the _aio_ has been closed.
In this case the provider should abandon the operation and do nothing else.
This operation should be called at the start of any I/O operation, and must
be called not more than once for a given I/O operation on a given _aio_.
Once this function is called, if `true` is returned, then the provider MUST
guarantee that [`nng_aio_finish()`][nng_aio_finish] is called for the _aio_
exactly once, when the operation is complete or canceled.
> [!TIP]
> This function is only for I/O providers (those actually performing
> the operation such as HTTP handler functions or transport providers); ordinary
> users of the _aio_ should not call this function.
## RETURN VALUES
- `true`: The operation has been started.
- `false`: The operation cannot be started.
## SEE ALSO
[nng_aio_cancel][nng_aio_cancel],
[nng_aio_defer][nng_aio_defer],
[nng_aio_finish][nng_aio_finish]
{{#include ../refs.md}}
|