Back to index

lightning-sunbird  0.9+nobinonly
Functions
ipcConnectionStub.cpp File Reference
#include "ipcConnection.h"
#include "nsError.h"

Go to the source code of this file.

Functions

nsresult IPC_Connect (const char *daemonPath)
 IPC_Connect.
nsresult IPC_Disconnect ()
 IPC_Disconnect.
nsresult IPC_SendMsg (ipcMessage *msg)
 IPC_SendMsg.
nsresult IPC_DoCallback (ipcCallbackFunc func, void *arg)
 IPC_DoCallback.

Function Documentation

nsresult IPC_Connect ( const char *  daemonPath)

IPC_Connect.

This function causes a connection to the IPC daemon to be established. If a connection already exists, then this function will be ignored.

Parameters:
daemonPathSpecifies the path to the IPC daemon executable.

NOTE: This function must be called on the main thread.

Definition at line 49 of file ipcConnectionStub.cpp.

IPC_Disconnect.

This function causes a connection to the IPC daemon to be closed. Any unsent messages (IPC_SendMsg puts messages on a queue) will be sent to the IPC daemon before the connection is closed.

NOTE: This function must be called on the main thread.

Definition at line 55 of file ipcConnectionStub.cpp.

IPC_DoCallback.

This function executes a callback function on the same background thread that calls IPC_OnConnectionEnd and IPC_OnMessageAvailable.

If this function succeeds, then the caller is guaranteed that |func| will be called. This guarantee is important because it allows the caller to free any memory associated with |arg| once |func| has been called.

NOTE: This function may be called on any thread.

Definition at line 67 of file ipcConnectionStub.cpp.

IPC_SendMsg.

This function sends a message to the IPC daemon. Typically, the message is put on a queue, to be delivered asynchronously to the IPC daemon. The ipcMessage object will be deleted when IPC_SendMsg is done with it. The caller must not touch |msg| after passing it to IPC_SendMsg.

IPC_SendMsg cannot be called before IPC_Connect or after IPC_Disconnect.

NOTE: This function may be called on any thread.

Definition at line 61 of file ipcConnectionStub.cpp.