next up previous contents
Next: 9 Mutexes Up: 8 Interprocess Communication Previous: 8.20 fluke_ipc_side_send_over_receive: send a

8.21 fluke_ipc_wait_receive: wait on a port set for incoming IPC invocations

SYNOPSIS

fluke_ipc_error_t fluke_ipc_wait_receive( fluke_ipc_params_t *ipc_params, void **port_alias);

DESCRIPTION

This function causes the current thread to wait for and receive incoming IPCs on a port set. A message of any flavor (one-way, idempotent, reliable) may be received using this function. The port set to receive from must have already been set up through a previous call to fluke_ipc_setup_wait_receive.

The caller must provide one or more message buffers into which to receive the incoming message. For one-way and idempotent IPC, the entire incoming message will be copied into the buffer before this function returns and the server thread receives control again. If the receive buffer is too small for the incoming message, then the message will be silently truncated.

For reliable IPC invocations, the first part of the incoming message is received into the provided receive buffers and references; however, if all of the data and references to be received do not fit in the initial buffers provided, then the fluke_ipc_wait_receive operation will return, and the server must prepare more receive buffers or references and call fluke_ipc_server_receive one or more times to receive the remainder of the incoming message.

If the current thread is already connected to a client when this call is made, the existing connection is broken as if by fluke_ipc_server_disconnect before the server thread goes to sleep waiting for a new connection.

PARAMETERS

ipc_params
A pointer to a structure describing data buffers and reference objects to receive information into. Only the receive parameter fields in this structure are used; the send parameter fields are ignored.
port_alias
When an incoming IPC request is successfully received, this pointer is set to the port alias attached to the port through which the IPC invocation was made, allowing the server to distinguish requests to different ports that are attached to a single port set.

RETURNS

This function returns a status code providing information about the received invocation. All of these have an implicit FLUKE_ prefix.
SUCCESS
If this was a reliable invocation, a reliable IPC connection was established, and the entire initial message from the client was received into the the server's receive buffers and references. For oneway or idempotent invocations, either the entire message or as much as would fit in the server's buffers was received. For all cases, the ipc_params structure is updated appropriately to indicate the amount of data and references received.
IPC_RECV_MORE_DATA
A reliable IPC connection was established, but all of the server's data buffers filled up before the client finished sending its first message. The server must make more room for incoming data and call fluke_ipc_server_receive to receive it. The ipc_params structure is updated appropriately to indicate the number of references received.
IPC_RECV_MORE_REFS
A reliable IPC connection was established, but all of the server's references were filled before the client finished sending its first message. The server must make room for more references and call fluke_ipc_server_receive to receive it. The ipc_params structure is updated appropriately to indicate the amount of data received.
IPC_RECV_DISCONNECTED
A reliable IPC connection was established, but the sender disconnected afterwards after sending some data but before the receiver's buffers were filled. The ipc_params structure is updated appropriately to indicate the amount of data and references received.
IPC_WAIT_ONEWAY
A one-way message was received. The caller merely needs to process the message and then wait for more messages if appropriate; no response of any kind is required.
IPC_WAIT_IDEMPOTENT
An idempotent message was received. The caller should process the message and then reply to it using fluke_ipc_reply.

ERRORS

If any of the following errors is detected by the Fluke implementation, it causes the current thread to take a synchronous exception with one of the following codes. All of these have an implicit FLUKE_INSANITY_ prefix.
NO_OBJECT
A pointer in the ipc_params receive reference array does not refer to an active object.
NOT_REF
An object in the ipc_params receive reference array is not a reference object.
INVALID_OBJECT
The state of an object in the ipc_params receive reference array is invalid.
BUFFER_UNALIGNED
A message buffer was not aligned properly according to the architecture-specific requirements.

RELATED INFORMATION

fluke_ipc_setup_wait_receive, fluke_ipc_send, fluke_ipc_call, fluke_ipc_reply, fluke_ipc_client_connect_send


next up previous contents
Next: 9 Mutexes Up: 8 Interprocess Communication Previous: 8.20 fluke_ipc_side_send_over_receive: send a

Utah Flux Research Group