---
name: "Eet_Connection_Group"
section: "3"
platform: "linux"
package: "libeet-doc"
version: "1.3.2-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/Eet_Connection_Group"
---

# Eet\_Connection\_Group(3)

Function that reconstruct and prepare packet of Eet Data Serialization to be send.

## NAME

Helper function to use eet over a network link -

Function that reconstruct and prepare packet of **Eet Data Serialization** to be send.

### Typedefs

typedef struct \_Eet\_Connection **Eet\_Connection**\
 *Opaque handle to track paquet for a specific connection.*  typedef Eina\_Bool **Eet\_Read\_Cb** (const void \*eet\_data, size\_t size, void \*user\_data)\
 *Called back when an* **Eet Data Serialization** *has been received completly and could be used.*  typedef Eina\_Bool **Eet\_Write\_Cb** (const void \*data, size\_t size, void \*user\_data)\
 *Called back when a packet containing* **Eet Data Serialization** *data is ready to be send.*

### Functions

EAPI **Eet\_Connection** \* **eet\_connection\_new** (**Eet\_Read\_Cb** \*eet\_read\_cb, **Eet\_Write\_Cb** \*eet\_write\_cb, const void \*user\_data)\
 *Instanciate a new connection to track.*  EAPI int **eet\_connection\_received** (**Eet\_Connection** \*conn, const void \*data, size\_t size)\
 *Process a raw packet received over the link  conn Connection handler to track.*  EAPI Eina\_Bool **eet\_connection\_send** (**Eet\_Connection** \*conn, **Eet\_Data\_Descriptor** \*edd, const void \*data\_in, const char \*cipher\_key)\
 *Convert a complex structure and prepare it to be send.*  EAPI Eina\_Bool **eet\_connection\_node\_send** (**Eet\_Connection** \*conn, **Eet\_Node** \*node, const char \*cipher\_key)\
 *Convert a Eet\_Node tree and prepare it to be send.*  EAPI void \* **eet\_connection\_close** (**Eet\_Connection** \*conn, Eina\_Bool \*on\_going)\
 *Close a connection and lost its track.*

## Detailed Description

Function that reconstruct and prepare packet of **Eet Data Serialization** to be send.

## Function Documentation

### EAPI void\* eet\_connection\_close (Eet\_Connection \* conn, Eina\_Bool \* on\_going)

Close a connection and lost its track. conn Connection handler to close.

**Parameters:**

*on\_going* Signal if a partial packet wasn't completed.

**Returns:**

the user\_data passed to both callback.

**Since:**

1\.2.4

### EAPI Eet\_Connection\* eet\_connection\_new (Eet\_Read\_Cb \* eet\_read\_cb, Eet\_Write\_Cb \* eet\_write\_cb, const void \* user\_data)

Instanciate a new connection to track. eet\_read\_cb Function to call when one Eet\_Data packet has been fully assemble.

**Parameters:**

*eet\_write\_cb* Function to call when one Eet\_Data packet is ready to be send over the wire. \
 *user\_data* Pointer provided to both functions to be used as a context handler.

**Returns:**

NULL on failure, or a valid Eet\_Connection handler.

For every connection to track you will need a separate Eet\_Connection provider.

**Since:**

1\.2.4

### EAPI Eina\_Bool eet\_connection\_node\_send (Eet\_Connection \* conn, Eet\_Node \* node, const char \* cipher\_key)

Convert a Eet\_Node tree and prepare it to be send. conn Connection handler to track.

**Parameters:**

*node* The data tree to use when encoding. \
 *cipher\_key* The key to use as cipher.

**Returns:**

EINA\_TRUE if the data where correctly send, EINA\_FALSE if they don't.

This function serialize node, assemble the packet and call Eet\_Write\_Cb when ready. The data passed Eet\_Write\_Cb are temporary allocated and will vanish just after the return of the callback.

**See also:**

**eet\_data\_node\_encode\_cipher**

**Since:**

1\.2.4

References eet\_data\_node\_encode\_cipher().

### EAPI int eet\_connection\_received (Eet\_Connection \* conn, const void \* data, size\_t size)

Process a raw packet received over the link  conn Connection handler to track. **Parameters:**

*data* Raw data packet. \
 *size* The size of that packet.

**Returns:**

0 on complete success, any other value indicate where in the stream it got wrong (It could be before that packet).

Every time you receive a packet related to your connection, you should pass it to that function so that it could process and assemble packet has you receive it. It will automatically call Eet\_Read\_Cb when one is fully received.

**Since:**

1\.2.4

### EAPI Eina\_Bool eet\_connection\_send (Eet\_Connection \* conn, Eet\_Data\_Descriptor \* edd, const void \* data\_in, const char \* cipher\_key)

Convert a complex structure and prepare it to be send. conn Connection handler to track.

**Parameters:**

*edd* The data descriptor to use when encoding. \
 *data\_in* The pointer to the struct to encode into data. \
 *cipher\_key* The key to use as cipher.

**Returns:**

EINA\_TRUE if the data where correctly send, EINA\_FALSE if they don't.

This function serialize data\_in with edd, assemble the packet and call Eet\_Write\_Cb when ready. The data passed Eet\_Write\_Cb are temporary allocated and will vanish just after the return of the callback.

**See also:**

**eet\_data\_descriptor\_encode\_cipher**

**Since:**

1\.2.4

References eet\_data\_descriptor\_encode\_cipher().

## Author

Generated automatically by Doxygen for Eet from the source code.
