qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Asynchronous I/O operations, networking, and related utilities. More...

Collaboration diagram for IO System:

Topics

 Asynchronous System
 Core mechanisms for event-driven asynchronous programming.
 Networking Utilities
 Socket wrappers, endpoint representation, and URI parsing.
 Transport Layer
 Abstractions over network sockets and file operations for stream-based I/O.
 Protocol Handling
 Message framing and parsing implementations.
 File System Operations
 Components for interacting with the local file system.
 Cryptographic Utilities
 Hashing, encryption, and JWT functionalities (requires OpenSSL).
 Compression Utilities
 Data compression and decompression (requires Zlib).
 JSON Utilities
 JSON parsing, manipulation, and serialization utilities.

Files

file  io.h
 Core I/O and logging utilities for the qb framework.
file  async.h
 Main include file for the QB asynchronous I/O library.
file  epoll.h
 Epoll-based event polling for Linux systems.
file  all.h
 Aggregation of all event types for the asynchronous I/O system.
file  base.h
 Base class for asynchronous events in the QB IO library.
file  file.h
 Asynchronous file operations for the QB IO library.
file  io.h
 Core asynchronous I/O class templates for event-driven operations.
file  protocol.h
 Protocol interfaces for message processing in the asynchronous IO framework.
file  config.h
 Configuration and platform-specific definitions for the QB IO library.
file  accept.h
 Protocol for accepting new connections in asynchronous I/O.
file  base.h
 Base protocol implementations for message framing in the QB IO system.
file  handshake.h
 Protocol for handling the handshake of a new connection.
file  json.h
 JSON protocol implementations for the QB IO system.
file  text.h
 Protocols for processing text and binary messages in the QB IO system.
file  stream.h
 Core stream abstraction classes for the QB IO library.
file  uri.h
 URI parsing and manipulation utilities.

Macros

#define QB_ENABLE_UDS   1
 Enables Unix Domain Socket support via SOCK_STREAM.
#define QB__DECL
 Function declaration specifier that changes based on whether header-only mode is enabled.
#define QB_INTEROP_DECL
 Interoperability declaration for function pointers.
#define QB_ARRAYSIZE(A)
 Macro to calculate the number of elements in a statically-allocated array.
#define QB_SSIZEOF(T)
 Macro to get the size of a type as a signed integer.
#define QB_OBSOLETE_DEPRECATE(_Replacement)
 Marks functions as deprecated with a replacement suggestion.
#define QB_VERSION_NUM   0x033705
 Defines the QB library version number in hexadecimal format.
#define QB_DEFAULT_MULTICAST_TTL   (int) 128
 Default Time-To-Live value for multicast packets.
#define QB_INET_BUFFER_SIZE   65536
 Maximum size for internet protocol buffers.
#define QB_MAX_PDU_BUFFER_SIZE   static_cast<int>(1 * 1024 * 1024)
 Maximum Protocol Data Unit buffer size.
#define QB_UNPACK_MAX_STRIP   32
 Maximum number of initial bytes that can be stripped during unpacking.
#define SD_RECEIVE   SHUT_RD
 Socket shutdown flag for disabling receive operations.
#define SD_SEND   SHUT_WR
 Socket shutdown flag for disabling send operations.
#define SD_BOTH   SHUT_RDWR
 Socket shutdown flag for disabling both send and receive operations.
#define closesocket   close
 Cross-platform macro for closing a socket.
#define ioctlsocket   ioctl
 Cross-platform macro for socket I/O control.
#define FD_TO_SOCKET(fd)
 Converts a file descriptor to a socket handle.
#define OPEN_FD_FROM_SOCKET(sock)
 Converts a socket handle to a file descriptor.
#define SD_NONE   -1
 Special value indicating no socket shutdown operation.
#define MAXNS   3
 Maximum number of nameservers.
#define IN_MAX_ADDRSTRLEN   INET6_ADDRSTRLEN
 Maximum length of string representation for an IP address.

Typedefs

typedef int socket_type
 Cross-platform socket handle type.

Detailed Description

Asynchronous I/O operations, networking, and related utilities.

Provides non-blocking I/O for TCP, UDP, SSL, files, along with protocols, cryptographic functions, and compression.

Macro Definition Documentation

◆ QB_ENABLE_UDS

#define QB_ENABLE_UDS   1

Enables Unix Domain Socket support via SOCK_STREAM.

When defined as 1, enables support for Unix Domain Sockets which provide efficient inter-process communication on Unix-like systems

◆ QB__DECL

#define QB__DECL

Function declaration specifier that changes based on whether header-only mode is enabled.

When QB_HEADER_ONLY is defined, functions are marked as inline

◆ QB_INTEROP_DECL

#define QB_INTEROP_DECL

Interoperability declaration for function pointers.

Used for properly storing managed C# functions as C++ function pointers Uses __stdcall on 32-bit Windows platforms

◆ QB_ARRAYSIZE

#define QB_ARRAYSIZE ( A)
Value:
(sizeof(A) / sizeof((A)[0]))

Macro to calculate the number of elements in a statically-allocated array.

Parameters
AArray to determine the size of
Returns
Number of elements in the array

◆ QB_SSIZEOF

#define QB_SSIZEOF ( T)
Value:
static_cast<int>(sizeof(T))

Macro to get the size of a type as a signed integer.

Parameters
TType to get the size of
Returns
Size of the type as a signed integer

◆ QB_OBSOLETE_DEPRECATE

#define QB_OBSOLETE_DEPRECATE ( _Replacement)

Marks functions as deprecated with a replacement suggestion.

Cross-platform macro that applies the appropriate compiler-specific deprecation annotation. On GCC/Clang, it uses attribute((deprecated)), on MSVC it uses __declspec(deprecated) with a message suggesting the replacement.

Parameters
_ReplacementThe recommended replacement function name

◆ QB_VERSION_NUM

#define QB_VERSION_NUM   0x033705

Defines the QB library version number in hexadecimal format.

Format is 0xMMNNRR where MM=major, NN=minor, RR=revision

◆ QB_DEFAULT_MULTICAST_TTL

#define QB_DEFAULT_MULTICAST_TTL   (int) 128

Default Time-To-Live value for multicast packets.

Sets the default number of hops a multicast packet can traverse

◆ QB_INET_BUFFER_SIZE

#define QB_INET_BUFFER_SIZE   65536

Maximum size for internet protocol buffers.

Defines the maximum buffer size for TCP/IP communication (65536 bytes)

◆ QB_MAX_PDU_BUFFER_SIZE

#define QB_MAX_PDU_BUFFER_SIZE   static_cast<int>(1 * 1024 * 1024)

Maximum Protocol Data Unit buffer size.

Limits the size of PDU buffers to avoid large memory allocations when decoding (1MB)

◆ QB_UNPACK_MAX_STRIP

#define QB_UNPACK_MAX_STRIP   32

Maximum number of initial bytes that can be stripped during unpacking.

Limits the number of bytes that can be removed from the beginning of a message during protocol unpacking operations

◆ SD_RECEIVE

#define SD_RECEIVE   SHUT_RD

Socket shutdown flag for disabling receive operations.

Cross-platform macro that maps to platform-specific constants (SHUT_RD on Unix, SD_RECEIVE on Windows)

◆ SD_SEND

#define SD_SEND   SHUT_WR

Socket shutdown flag for disabling send operations.

Cross-platform macro that maps to platform-specific constants (SHUT_WR on Unix, SD_SEND on Windows)

◆ SD_BOTH

#define SD_BOTH   SHUT_RDWR

Socket shutdown flag for disabling both send and receive operations.

Cross-platform macro that maps to platform-specific constants (SHUT_RDWR on Unix, SD_BOTH on Windows)

◆ closesocket

#define closesocket   close

Cross-platform macro for closing a socket.

Maps to close() on Unix systems, keeps closesocket() on Windows

◆ ioctlsocket

#define ioctlsocket   ioctl

Cross-platform macro for socket I/O control.

Maps to ioctl() on Unix systems, keeps ioctlsocket() on Windows

◆ FD_TO_SOCKET

#define FD_TO_SOCKET ( fd)
Value:
fd

Converts a file descriptor to a socket handle.

On Unix, returns fd unchanged. On Windows, converts using _get_osfhandle()

Parameters
fdFile descriptor to convert
Returns
Equivalent socket handle

◆ OPEN_FD_FROM_SOCKET

#define OPEN_FD_FROM_SOCKET ( sock)
Value:
sock

Converts a socket handle to a file descriptor.

On Unix, returns sock unchanged. On Windows, converts using _open_osfhandle()

Parameters
sockSocket handle to convert
Returns
Equivalent file descriptor

◆ SD_NONE

#define SD_NONE   -1

Special value indicating no socket shutdown operation.

Used to indicate that no shutdown operation should be performed

◆ MAXNS

#define MAXNS   3

Maximum number of nameservers.

Defines the maximum number of DNS nameservers that can be configured

◆ IN_MAX_ADDRSTRLEN

#define IN_MAX_ADDRSTRLEN   INET6_ADDRSTRLEN

Maximum length of string representation for an IP address.

Set to INET6_ADDRSTRLEN to accommodate IPv6 addresses, which are longer than IPv4

Typedef Documentation

◆ socket_type

typedef int socket_type

Cross-platform socket handle type.

int on Unix systems, SOCKET (unsigned integer) on Windows