Client

/* @file aisl/types.h */

typedef struct aisl_client * AislClient;

Pointer of this type represents HTTP client connected to an AislServer.

AislClient can be a source of the following events:

Functions


Function aisl_client_get_server

Gets an AislServer associated with a valid AislClient

AislServer
aisl_client_get_server(AislClient client);

Arguments

Return value

Associated AislServer


Function aisl_client_get_address

Copies client’s address and port to provided sockaddr_in structure

void
aisl_client_get_address(AislClient client, struct sockaddr_in *address);

Arguments

Return value

Returns no value.


Function aisl_client_get_http_version

Gets the HTTP version of the communication with AislClient. For just connected clients version is set to default AISL_HTTP_1_0.

AislHttpVersion
aisl_client_get_http_version(AislClient client);

Arguments

Return value

AislHttpVersion constant


Function aisl_client_disconnect

Closes client’s socket immediately. Resources will be cleaned up automatically by aisl_run_cycle call.

void
aisl_client_disconnect(AislClient client);

Arguments

Return value

Returns no value.


Function aisl_client_is_secure

Checks if client works on HTTPS (secure) or HTTP (unsecure) protocol.

bool
aisl_client_is_secure(AislClient client);

Arguments

Return value


Function aisl_client_get_is_online

Checks if connection with client is still up.

bool
aisl_client_is_online(AislClient client);

Arguments

Return value