docs/API.md
These functions enable you to obtain the spool version and insert some hooks into the spool,
such as SW_GLOBAL_HOOK_BEFORE_SERVER_START. The set function is called when the server starts.
The header file is swoole_api.h.
The symbol of this file will export the function name in C format, not C++.
Similarly, functions in the Coroutine API are also exported as C functions.
swoole_version() Get the current version of Swooleswoole_add_hook() Add a hook function to the specified hook pointThese functions are similar to the C function in unistd.h, for example, read corresponds to
swoole_coroutine_read() in the coroutine environment.
In addition to the POSIX API like functions, some additional functions can be provided.
For example, the swoole_coroutine_get_current_id() can obtain the ID of the coroutine,
which is equivalent to the getpid() of the process.
The function similar to creating a process or thread is swoole_coroutine_create(),
which can be used to create a coroutine.
The header file is swoole_coroutine_api.h.
Use C/C++ macros to automatically replace read/write and other synchronously blocked unistd C functions as non blocking
coroutine functions (starts with swoole_coroutine_).
This method enables C++ network client code to be used in the swoole coroutine environment.
Including network and file system:
swoole_file_hook.h Replace file system related functions, such as open(), mkdir(), etcswoole_socket_hook.h Replace network related functions, such as socket(), recv(), send(), etcIn addition to the above header files, others are only used in C++ code.
These header files have no dependencies. They can only contain C standard library header files, C++ header files, and platform related or basic library header files.
swoole_config.h: Buffer size, string, constant, etcswoole_version.h: Swoole version informationswoole_atomic.h: Atomic operationsswoole_asm_context.h: Assembly context switchingswoole_util.h: Common utility functionsswoole_log.h: Log related functionsswoole_memory.h: Memory pool related functionsswoole_base64.h: Base64 encoding and decodingswoole_error.h: Error code related functionsswoole.h: Core class and function declarationsswoole_string.h: String class and function declarationsswoole_coroutine.h: Coroutine class and function declarationsswoole_async.h: Asynchronous IO class and function declarationsswoole_process_pool.h: Process pool class and function declarationsswoole_signal.h: Signal handling class and function declarationsswoole_timer.h: Timer class and function declarationsswoole_reactor.h: Reactor class and function declarationsThese header files depend on the core header files and provide a higher level of abstraction.
swoole_server.h: Server side class and function declarationsswoole_client.h: Client side class and function declarationsswoole_coroutine_socket.h: Coroutine socket class and function declarationsswoole_coroutine_system.h: Coroutine system API class and function declarationsswoole_coroutine_channel.h: Coroutine channel class and function declarations