next up previous contents
Next: 8.6 fluke_ipc_client_connect_send_over_receive: perform a Up: 8 Interprocess Communication Previous: 8.4 fluke_ipc_call: make a

8.5 fluke_ipc_client_connect_send: create a reliable connection to a server

SYNOPSIS

fluke_error_t fluke_ipc_client_connect_send(fluke_ref_t *destination, fluke_ipc_params_t *ipc_params);

DESCRIPTION

This function initiates a reliable IPC connection with the server controlling the port referred to by the destination port reference. If successful, a server thread will be found and attached to the current (client) thread. The client can then commence communication using the fluke_ipc_client_op family of operations. Initially the client is the sender and the server is the receiver.

Upon successfully establishing a connection, the data and/or references described by the send parameter fields in ipc_params are immediately sent to the server as the first part of the client's message. The number of words in the first data buffer to send, ipc_params->send_buf.words, must be at least FLUKE_MIN_MSG_SIZE; it is impossible to establish a connection without transferring this minimum amount of data at the same time. However, note that this minimum message size restriction only applies at the time of connection establishment; subsequent fluke_ipc_client_send calls accept buffers of any size, subject to any alignment restrictions the architecture may impose. Furthermore, there are no minimums imposed on references being sent.

If the current thread is already connected to a server when this call is made, the existing connection is broken as if by fluke_ipc_client_disconnect.

PARAMETERS

destination
A pointer to a port reference indicating the port to invoke.
ipc_params
A pointer to a structure describing data and references to send. Only the send parameter fields in this structure are used; the receive parameter fields are ignored. All fields remain unmodified by the call.

RETURNS

Returns one of the following codes: All of these have an implicit FLUKE_ prefix.
SUCCESS
The connection has been established, and all data indicated by the send parameters in ipc_params has been sent (though not necessarily delivered yet to the receiver).
IPC_CONNECT_INVALID_DEST
The IPC target referenced by destination is invalid, e.g. because the port it refers to was destroyed or the server task was terminated. Note that if the IPC destination is invalid, it is unspecified whether this condition will be detected at connection time by this function, or at a later stage such as the first send or receive. Application code must in general be prepared to handle error conditions detected at any time during communication.

IPC_SEND_DISCONNECTED
The connection was successfully established, but it was broken while sending the data and references specified.

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
No active object was found at destination. A pointer in the ipc_params send reference array does not refer to an active object.
NOT_REF
The object at destination is not a reference object. An object in the ipc_params send reference array is not a reference object.
NOT_PORT_REF
The object at destination is a reference object, but not a reference to a port.
INVALID_OBJECT
The state of the object at destination is invalid or the state of an object in the ipc_params send reference array is invalid.
BUFFER_TOO_SMALL
The initial send data was smaller than FLUKE_MIN_MSG_SIZE.
BUFFER_UNALIGNED
A message buffer was not aligned properly according to the architecture-specific requirements.

RELATED INFORMATION

fluke_ipc_client_send, fluke_ipc_client_receive, fluke_ipc_client_over, fluke_ipc_client_disconnect, fluke_ipc_wait_receive


next up previous contents
Next: 8.6 fluke_ipc_client_connect_send_over_receive: perform a Up: 8 Interprocess Communication Previous: 8.4 fluke_ipc_call: make a

Utah Flux Research Group