next up previous contents
Next: 8.18 fluke_ipc_side_receive: receive data Up: 8 Interprocess Communication Previous: 8.16 fluke_ipc_side_disconnect: destroy a

8.17 fluke_ipc_side_over_receive: reverse the transfer direction of a reliable IPC connection

SYNOPSIS

fluke_error_t fluke_ipc_side_over_receive( fluke_ipc_params_t *ipc_params);

DESCRIPTION

This function allows the current sender on a reliable IPC connection to switch roles and become the receiver. If the current receiver is waiting for data in an fluke_ipc_side_receive operation, its receive operation will immediately return FLUKE_SUCCESS, indicating that all information in that message has been received and the sender is ready to reverse the connection. The receiver must then perform an ack_send operation in order to complete the connection reversal and begin transferring information in the other direction. If the receiver was already waiting in an ack_send operation, the reversal takes place immediately.

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.

RETURNS

Returns one of the following codes: All of these have an implicit FLUKE_ prefix.
SUCCESS
The connection reversal has succeeded and the entire message subsequently sent by the other side was received into the initial receive buffers and references provided to this operation. The other side is now ready to reverse the connection again.
IPC_OVER_DISCONNECTED
The IPC connection does not exist, or was broken unexpectedly for some reason before the connection reversal actually took place, e.g. because the other side disconnected or was terminated.
IPC_RECV_MORE_DATA
The connection was reversed successfully, but all of the provided data buffers filled up before the sender finished transferring its first message. The caller must make more room for incoming data and use fluke_ipc_side_receive to receive it. The ipc_params structure is updated appropriately to indicate the amount of data received.
IPC_RECV_MORE_REFS
The connection was reversed successfully, but all of the provided references were filled before the sender finished transferring its first message. The caller must make room for more references and use fluke_ipc_side_receive to receive them. The ipc_params structure is updated appropriately to indicate the number of references received.
IPC_RECV_DISCONNECTED
The connection was reversed successfully, but the sender disconnected afterwards before the receiver's buffers filled up. The ipc_params structure is updated appropriately to indicate the amount of data and references received. This return code often indicates normal connection termination.

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.
NOT_SENDER
The current thread is not the sender on the specified IPC connection.
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_side_ack_send, fluke_ipc_side_send, fluke_ipc_side_receive


next up previous contents
Next: 8.18 fluke_ipc_side_receive: receive data Up: 8 Interprocess Communication Previous: 8.16 fluke_ipc_side_disconnect: destroy a

Utah Flux Research Group