JULEA
|
Data Structures | |
struct | JNetworkConnectionMemory |
struct | JNetworkConnectionMemoryID |
struct | JNetworkFabricAddr |
struct | JNetworkFabric |
struct | JNetworkConnection |
Macros | |
#define | KEY_MIN 1 |
#define | J_NETWORK_CONNECTION_MAX_SEND 2 |
#define | J_NETWORK_CONNECTION_MAX_RECV 1 |
#define | EXE(cmd, ...) |
#define | CHECK(msg) |
#define | G_CHECK(msg) |
Typedefs | |
typedef struct JNetworkConnection | JNetworkConnection |
typedef enum JNetworkConnectionAck | JNetworkConnectionAck |
typedef struct JNetworkConnectionMemory | JNetworkConnectionMemory |
typedef struct JNetworkConnectionMemoryID | JNetworkConnectionMemoryID |
typedef struct JNetworkFabric | JNetworkFabric |
typedef struct JNetworkFabricAddr | JNetworkFabricAddr |
typedef enum JNetworkFabricSide | JNetworkFabricSide |
typedef enum JNetworkFabricEvents | JNetworkFabricEvents |
typedef enum JNetworkConnectionEvents | JNetworkConnectionEvents |
Enumerations | |
enum | JNetworkConnectionAck { J_NETWORK_CONNECTION_ACK = 42 } |
enum | JNetworkFabricSide { JF_SERVER , JF_CLIENT } |
enum | JNetworkFabricEvents { J_FABRIC_EVENT_ERROR = 0 , J_FABRIC_EVENT_TIMEOUT , J_FABRIC_EVENT_CONNECTION_REQUEST , J_FABRIC_EVENT_SHUTDOWN } |
enum | JNetworkConnectionEvents { J_CONNECTION_EVENT_ERROR = 0 , J_CONNECTION_EVENT_TIMEOUT , J_CONNECTION_EVENT_CONNECTED , J_CONNECTION_EVENT_SHUTDOWN } |
#define CHECK | ( | msg | ) |
#define EXE | ( | cmd, | |
... | |||
) |
#define G_CHECK | ( | msg | ) |
#define J_NETWORK_CONNECTION_MAX_RECV 1 |
Highest number of j_network_connection_recv() calls before a j_network_connection_wait_for_completion().
#define J_NETWORK_CONNECTION_MAX_SEND 2 |
Highest number of j_network_connection_send() calls before a j_network_connection_wait_for_completion().
#define KEY_MIN 1 |
typedef struct JNetworkConnection JNetworkConnection |
typedef enum JNetworkConnectionAck JNetworkConnectionAck |
typedef enum JNetworkConnectionEvents JNetworkConnectionEvents |
typedef struct JNetworkConnectionMemory JNetworkConnectionMemory |
typedef struct JNetworkConnectionMemoryID JNetworkConnectionMemoryID |
typedef struct JNetworkFabric JNetworkFabric |
typedef struct JNetworkFabricAddr JNetworkFabricAddr |
typedef enum JNetworkFabricEvents JNetworkFabricEvents |
typedef enum JNetworkFabricSide JNetworkFabricSide |
Possible events for paired connections.
enum JNetworkFabricEvents |
Possible events for listening fabrics
enum JNetworkFabricSide |
gboolean j_network_connection_closed | ( | JNetworkConnection * | connection | ) |
Check if the connection was closed by the other party.
gboolean j_network_connection_fini | ( | JNetworkConnection * | connection | ) |
Closes a connection and free all related resources. * If this an client side connection with private fabric, it will also clear the fabric.
JNetworkConnection * j_network_connection_init_client | ( | JConfiguration * | configuration, |
JBackendType | backend, | ||
guint | index | ||
) |
Builds a direct connection to an active fabric.
This constructor will fetch the fabric address via TCP and then build a paired connection to this, which later allows for messaging and RMA data transfer. This will also construct a fabric for that connection, which is freed when the connection is finished.
[in] | configuration | A configuration. |
[in] | backend | A backend type. |
[in] | index | An index. |
JNetworkConnection * j_network_connection_init_server | ( | JNetworkFabric * | fabric, |
GSocketConnection * | gconnection | ||
) |
Establish connection to client based on established GSocketConnection. The GSocketConnection will be used to send the server fabric data. For the connection process see j_network_connection_init_client().
[in] | fabric | Fabric via which the connection should be established. |
[in] | connection | GSocketConnection for address exchange. |
gboolean j_network_connection_memory_get_id | ( | JNetworkConnectionMemory * | this, |
JNetworkConnectionMemoryID * | id | ||
) |
Gets identifier of memory region.
this | A memory region. | |
[out] | id | ID of registered memory. |
gboolean j_network_connection_recv | ( | JNetworkConnection * | connection, |
gsize | length, | ||
gpointer | data | ||
) |
Asynchronously receives data via MSG connection. Asynchronously receive a message. To wait for completion, use j_network_connection_wait_for_completion().
[in] | connection | A connection. |
[in] | length | A length in bytes. |
[out] | data | A data buffer to receive into. |
gboolean j_network_connection_rma_read | ( | JNetworkConnection * | connection, |
JNetworkConnectionMemoryID const * | memory_id, | ||
gpointer | data | ||
) |
Asynchronous direct memory read. Initiate an direct memory read. To wait for completion, use j_network_connection_wait_for_completion().
[in] | connection | A connection. |
[in] | memory_id | A memory ID for the segment that should be copied. |
[out] | data | A data buffer to receive into. |
gboolean j_network_connection_rma_register | ( | JNetworkConnection * | connection, |
gconstpointer | data, | ||
gsize | length, | ||
JNetworkConnectionMemory * | handle | ||
) |
Registers memory to make it RMA-readable. Memory access rights must changed to allow for an RMA read by the other party. Therefore, before a j_network_connection_rma_read() can succeed, the provider of the data must register the memory first!
[in] | connection | A connection. |
[in] | data | A data buffer to share. |
[in] | length | A length in bytes. |
[out] | handle | A handle for the memory region to unregister with j_network_connection_rma_unregister(). |
gboolean j_network_connection_rma_unregister | ( | JNetworkConnection * | connection, |
JNetworkConnectionMemory * | handle | ||
) |
Unregisters memory from RMA availablity. Counterpart to j_network_connection_rma_register().
[in] | connection | A connection. |
[in] | handle | A handle for the memory region to unregister. |
gboolean j_network_connection_send | ( | JNetworkConnection * | connection, |
gpointer | data, | ||
gsize | length | ||
) |
Async send data via MSG connection. Asynchronously sends a message. To recognize completion, use j_network_connection_wait_for_completion(). If the message is small enough it can be injected to the network, in that case the actions finishes immediately (j_network_connection_wait_for_completion() still works).
feedback if message was injected
make data a gconstpointer if possible
[in] | connection | A connection. |
[in] | data | A data buffer to send. |
[in] | length | A length in bytes. |
gboolean j_network_connection_wait_for_completion | ( | JNetworkConnection * | connection | ) |
Waits until operations initiated at his connection finished.
JNetworkFabric * j_network_fabric_init_server | ( | JConfiguration * | configuration | ) |
Initializes a fabric for the server side. In difference to j_network_fabric_init_client, the resulting fabric is capable of reciving connection requests. Therefore, events can be read via j_fabric_sread_event.
[in] | configuration | A configuration. |