#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <gnet-2.0/pack.h>
#include <hiker/ipc.h>
#include <hiker/traces.h>
#include "alp_ipc_internal.h"
Functions | |
AlpChannel * | alp_ipc_channel_create (const gchar *channelName, AlpIpcChannelAccessMode accessMode) |
Creates an AlpChannel. | |
alp_status_t | alp_ipc_channel_destroy (AlpChannel *channel) |
Destroys an AlpChannel. | |
alp_status_t | alp_ipc_channel_register_connect_callback (AlpChannel *channel, AlpChannelConnectCB callback, gpointer cbData) |
Registers a callback for the server process whenever a client connects. | |
alp_status_t | alp_ipc_channel_register_disconnect_callback (AlpChannel *channel, AlpChannelDisconnectCB callback, gpointer cbData) |
Registers a callback for the server process whenever a client disconnects or exits without disconnecting. | |
AlpConnection * | alp_ipc_channel_connect (const gchar *channelName, AlpConnectionUsageHint usageHint, AlpChannelConnectCB callback, gpointer cbData) |
Requests a connection to a AlpChannel. | |
alp_status_t | alp_ipc_channel_connect_synch (const gchar *channelName, AlpConnectionUsageHint usageHint, guint timeout, AlpConnection **connection) |
Requests a connection to a AlpChannel. | |
alp_status_t | alp_ipc_channel_disconnect (AlpConnection *connection) |
Disconnects process from an AlpChannel. | |
void | alp_ipc_channel_set_custom_data (AlpChannel *channel, gpointer customData) |
Assigns a pointer to a custom block of data to be stored with this AlpChannel. | |
gpointer | alp_ipc_channel_get_custom_data (AlpChannel *channel) |
Retrieves the pointer to a custom block of data stored with this AlpChannel. | |
alp_status_t | alp_ipc_connection_register_disconnect_callback (AlpConnection *connection, AlpChannelDisconnectCB callback, gpointer cbData) |
Registers to receive a callback when the server disconnects by destroying the channel or exiting. | |
gint | alp_ipc_connection_get_peer_pid (const AlpConnection *connection) |
Returns the process ID of the peer process for this connection. | |
gint | alp_ipc_connection_get_peer_gid (const AlpConnection *connection) |
Returns the group ID of the peer process for this connection. | |
gint | alp_ipc_connection_get_peer_uid (const AlpConnection *connection) |
Returns the user ID of the peer process for this connection. | |
AlpMessage * | alp_ipc_message_create () |
Allocates a AlpMessage structure. | |
alp_status_t | alp_ipc_message_destroy (AlpMessage *msg) |
Cleans up and frees all memory associated with the message. | |
gint | alp_ipc_message_get_message_ID (AlpMessage *msg) |
Returns the message ID of the message. | |
alp_status_t | alp_ipc_connection_send (AlpConnection *connection, AlpMessage *message) |
Sends a message to the other end of a connection. | |
alp_status_t | alp_ipc_connection_send_with_response (AlpConnection *connection, AlpMessage *message, guint timeout, AlpMessage **response) |
Sends a message to the other end of a connection, then waits for a response message. | |
alp_status_t | alp_ipc_connection_receive (AlpConnection *connection, gint messageID, guint timeout, AlpMessage **message) |
Synchronously receive a message from the other end of a connection. | |
alp_status_t | alp_ipc_connection_register_receive_callback (AlpConnection *connection, AlpMessageReceiveCB callback, gpointer cbData) |
Registers to receive an asynchronous callback when a message is received by the connection. | |
void | alp_ipc_connection_set_custom_data (AlpConnection *connection, gpointer customData) |
Assigns a pointer to a custom block of data to be stored with this AlpConnection. | |
gpointer | alp_ipc_connection_get_custom_data (AlpConnection *connection) |
Retrieves the pointer to a custom block of data stored with this AlpConnection. | |
alp_status_t | alp_ipc_message_pack_start (AlpMessage *msg, gint msgID) |
Call to begin to pack a message into an existing AlpMessage struct. | |
alp_status_t | alp_ipc_message_response_pack_start (AlpMessage *msg, gint msgID, AlpMessage *msgToRespondTo) |
Call to begin to pack a response message into an existing AlpMessage struct. | |
alp_status_t | alp_ipc_message_pack_end (AlpMessage *msg) |
Call to finish packing a message into an existing AlpMessage struct. | |
alp_status_t | alp_ipc_message_pack_int32 (AlpMessage *msg, gint32 val) |
Adds an int32 value to the message. | |
alp_status_t | alp_ipc_message_pack_uint32 (AlpMessage *msg, guint32 val) |
Adds an uint32 value to the message. | |
alp_status_t | alp_ipc_message_pack_float (AlpMessage *msg, gfloat val) |
Adds a float value to the message. | |
alp_status_t | alp_ipc_message_pack_string (AlpMessage *msg, const gchar *val) |
Adds a null-terminated string value to the message. | |
alp_status_t | alp_ipc_message_pack_byte_array (AlpMessage *msg, guchar *array, guint numElements) |
Adds a array of bytes (i.e. unsigned chars) to the message. | |
alp_status_t | alp_ipc_message_unpack_start (AlpMessage *msg) |
Call to begin unpacking a message from an AlpMessage struct. | |
alp_status_t | alp_ipc_message_unpack_end (AlpMessage *msg) |
Call to finish unpacking a message from an AlpMessage struct. | |
alp_status_t | alp_ipc_message_unpack_int32 (AlpMessage *msg, gint32 *val) |
Unpacks an int32 value from the message. | |
alp_status_t | alp_ipc_message_unpack_uint32 (AlpMessage *msg, guint32 *val) |
Unpacks an uint32 value from the message. | |
alp_status_t | alp_ipc_message_unpack_float (AlpMessage *msg, gfloat *val) |
Unpacks a float value from the message. | |
alp_status_t | alp_ipc_message_unpack_string (AlpMessage *msg, gchar **val) |
Unpacks a null-terminated string from the message. | |
alp_status_t | alp_ipc_message_unpack_byte_array (AlpMessage *msg, guchar **array, guint *numElements) |
Unpacks an array of bytes (i.e. unsigned chars) from the message. |