|
| QSC_EXPORT_API void | qsc_socket_server_accept_callback (qsc_socket_server_accept_result *ares) |
| | The socket server accept callback prototype.
|
| |
| QSC_EXPORT_API void | qsc_socket_server_error_callback (const qsc_socket *source, qsc_socket_exceptions error) |
| | The socket server error callback prototype.
|
| |
| QSC_EXPORT_API qsc_socket_address_families | qsc_socket_server_address_family (const qsc_socket *sock) |
| | Get the sockets address family, IPv4 or IPv6.
|
| |
| QSC_EXPORT_API qsc_socket_protocols | qsc_socket_server_socket_protocol (const qsc_socket *sock) |
| | Get the socket protocol type.
|
| |
| QSC_EXPORT_API qsc_socket_transports | qsc_socket_server_socket_transport (const qsc_socket *sock) |
| | Get the socket transport type.
|
| |
| QSC_EXPORT_API void | qsc_socket_server_close_socket (qsc_socket *sock) |
| | Shut down channels and close the socket.
|
| |
| QSC_EXPORT_API void | qsc_socket_server_initialize (qsc_socket *sock) |
| | Initialize the server socket.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen (qsc_socket *source, qsc_socket *target, const char *address, uint16_t port, qsc_socket_address_families family) |
| | Places the source socket in a blocking listening state, and waits for a connection. Returns a single socket, and must be called to listen for each new connection.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen_ipv4 (qsc_socket *source, qsc_socket *target, const qsc_ipinfo_ipv4_address *address, uint16_t port) |
| | Places the source IPv4 socket in a blocking listening state, and waits for a connection. Returns a single socket, and must be called to listen for each new connection.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen_ipv6 (qsc_socket *source, qsc_socket *target, const qsc_ipinfo_ipv6_address *address, uint16_t port) |
| | Places the source IPv6 socket in a blocking listening state, and waits for a connection. Returns a single socket, and must be called to listen for each new connection.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen_async (qsc_socket_server_async_accept_state *state, const char *address, uint16_t port, qsc_socket_address_families family) |
| | Places the socket in an asynchronous listening state.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen_async_ipv4 (qsc_socket_server_async_accept_state *state, const qsc_ipinfo_ipv4_address *address, uint16_t port) |
| | Places the IPv4 socket in an asynchronous listening state.
|
| |
| QSC_EXPORT_API qsc_socket_exceptions | qsc_socket_server_listen_async_ipv6 (qsc_socket_server_async_accept_state *state, const qsc_ipinfo_ipv6_address *address, uint16_t port) |
| | Places the IPv6 socket in an asynchronous listening state.
|
| |
| QSC_EXPORT_API void | qsc_socket_server_set_options (const qsc_socket *sock, qsc_socket_protocols level, qsc_socket_options option, int32_t optval) |
| | Send an option command to the socket. Options that use a boolean are format: 0=false, 1=true.
|
| |
| QSC_EXPORT_API void | qsc_socket_server_shut_down (qsc_socket *sock) |
| | Shut down the server.
|
| |
The socket server function definitions.
This header provides the public API for socket server operations. It includes functions to initialize a server socket, listen for incoming connections (both synchronously and asynchronously), accept incoming connections, send and receive data, and manage socket options. The API supports both IPv4 and IPv6 addressing and is designed for use in multi-threaded server applications.
{
}
{
}
#define QSC_SOCKET_RET_SUCCESS
Definition socket.h:75
QSC_EXPORT_API qsc_socket_exceptions qsc_socket_server_listen_ipv4(qsc_socket *source, qsc_socket *target, const qsc_ipinfo_ipv4_address *address, uint16_t port)
Places the source IPv4 socket in a blocking listening state, and waits for a connection....
Definition socketserver.c:118
QSC_EXPORT_API void qsc_socket_server_accept_callback(qsc_socket_server_accept_result *ares)
The socket server accept callback prototype.
QSC_EXPORT_API void qsc_socket_server_initialize(qsc_socket *sock)
Initialize the server socket.
Definition socketserver.c:65
QSC_EXPORT_API void qsc_socket_server_error_callback(const qsc_socket *source, qsc_socket_exceptions error)
The socket server error callback prototype.
The async listener-accept state structure. The structure contains a pointer to the listener socket,...
Definition socketserver.h:116
void(* callback)(qsc_socket_server_accept_result *result)
Definition socketserver.h:118
void(* error)(qsc_socket *sock, qsc_socket_exceptions exception)
Definition socketserver.h:119
qsc_socket * source
Definition socketserver.h:117
The socket instance structure.
Definition socket.h:121
Reference Links: